Class Documentation

Name:Joyport
Version:1.0
ID:ID_JOYPORT
Status:Stable
Category:I/O
Date:May 2001
Author:Rocklyte Systems
Copyright:  Rocklyte Systems (c) 1996-2001. All rights reserved.
Short:  The Joyport class manages the joyports of the computer.



Description

The Joyport class provides a common interface that allows you to read data from joyport hardware. This class supports both digital and analogue input from devices that plug into the joyport(s), such as the mouse, joysticks and joypads. It manages the data in a convenient format that is passed through the data channel system. By doing so the class also supports software based input in order to support virtual devices and use of the keyboard to emulate a joystick or mouse for instance.

New joyport objects can only be created for the purpose of being assigned to certain hardware or virtual devices. If you want to create a Joyport object that represents the default joyport, give it a name of 'SystemJoystick'. Multiple joyport objects can be created all sharing the same name, so long as the Port setting for each object is different.

Actions

The Joyport class supports the following actions:

DataChannel  This action can be used to send fake joyport input.

Structure

The Joyport object consists of the following public fields:

LimitEast  Limits horizontal joyport movement.
LimitNorth  Limits vertical joyport movement.
LimitSouth  Limits vertical joyport movement.
LimitWest  Limits horizontal joyport movement.
Port  The hardware port represented by a Joyport object.
Action:DataChannel
Short:This action can be used to send fake joyport input.

It is possible to send software generated input to a Joyport object through this action, as if the user was controlling the device personally. All data that is sent to a Joyport object through this method will inevitably be reported to programs that read the Joyport through the DataChannel service.

Data must be sent using the DATA_JOYPORT type, as described in the Action List document.


Field:LimitEast
Short:Limits horizontal joyport movement.
Type:FLOAT
Status:Read/Write

The LimitEast field limits the horizontal range for which a joyport device can send movement values. If a joyport device sends a value that exceeds a set limit, the value will be restricted to the maximum value indicated by the limit setting. This particular field specifically limits movement to the east (right) and is paired with the LimitWest field. Valid values for this field start from 0 and increase in value to a maximum of 10000.


Field:LimitNorth
Short:Limits vertical joyport movement.
Type:FLOAT
Status:Read/Write

The LimitNorth field limits the vertical range for which a joyport device can send movement values. If a joyport device sends a value that exceeds a set limit, the value will be restricted to the maximum value indicated by the limit setting. This particular field specifically limits movement to the north (up) and is paired with the LimitSouth field. Valid values for this field start from 0 and decrease in value to a maximum of -10000.


Field:LimitSouth
Short:Limits vertical joyport movement.
Type:FLOAT
Status:Read/Write

The LimitSouth field limits the vertical range for which a joyport device can send movement values. If a joyport device sends a value that exceeds a set limit, the value will be restricted to the maximum value indicated by the limit setting. This particular field specifically limits movement to the south (down) and is paired with the LimitNorth field. Valid values for this field start from 0 and increase in value to a maximum of 10000.


Field:LimitWest
Short:Limits horizontal joyport movement.
Type:FLOAT
Status:Read/Write

The LimitWest field limits the horizontal range for which a joyport device can send movement values. If a joyport device sends a value that exceeds a set limit, the value will be restricted to the maximum value indicated by the limit setting. This particular field specifically limits movement to the west (left) and is paired with the LimitEast field. Valid values for this field start from 0 and decrease in value to a maximum of -10000.


Field:Port
Short:The hardware port represented by a Joyport object.
Type:LONG
Status:Read/Init

This field specifies the port that a Joyport object represents. Generally this will only be set to 1 (the mouse port) or 2 (the first joystick port). If set to 3 or higher, the port that is monitored depends on the hardware configuration. If there is no hardware associated for a given port, the Joyport object will be considered to be virtual and will have to receive its information from an external source.