Joystick Driver Interface Definitions.
Joystick drivers define a single VFS node, that acts as a fixed size file. Reads from this file return the current state, writes are ignored.
The device file must begin with a valid sJoystick_FileHeader structure. The file header is followed by NAxies instances of sJoystick_Axis, one for each axis. This is followed by NButtons boolean values (represented using Uint8), each representing the state of a single button (where 0 is unpressed, 0xFF is fully depressed - intermediate values are valid in the case of variable-pressure buttons)
Go to the source code of this file.
Data Structures | |
struct | sJoystick_FileHeader |
struct | sJoystick_Axis |
Axis Definition. More... | |
Typedefs | |
typedef void(* | tJoystickCallback )(int Ident, int bIsAxis, int Num, int Delta) |
Callback type for JOY_IOCTL_SETCALLBACK. | |
Enumerations | |
enum | eTplJoystick_IOCtl { JOY_IOCTL_SETCALLBACK = 4, JOY_IOCTL_GETSETAXISLIMIT, JOY_IOCTL_GETSETAXISFLAGS, JOY_IOCTL_GETSETBUTTONFLAGS } |
Common Joystick IOCtl Calls. More... |
typedef void(* tJoystickCallback)(int Ident, int bIsAxis, int Num, int Delta) |
Callback type for JOY_IOCTL_SETCALLBACK.
Ident | Ident value passed to JOY_IOCTL_SETCALLBACK |
enum eTplJoystick_IOCtl |
Common Joystick IOCtl Calls.
JOY_IOCTL_SETCALLBACK |
Sets the callback. ioctl(..., struct{int Ident;tKeybardCallback *Callback})
Sets the callback that is called when a event occurs (button or axis change). This function pointer must be in kernel mode (although, kernel->user or kernel->ring3driver abstraction functions can be used) |
JOY_IOCTL_GETSETAXISLIMIT |
Set maximum value for sJoystick_Axis.CurState. ioctl(..., struct{int AxisNum;int Value})
|
JOY_IOCTL_GETSETAXISFLAGS |
Set axis flags. ioctl(..., struct{int AxisNum;int Value})
|
JOY_IOCTL_GETSETBUTTONFLAGS |
Set Button Flags. ioctl(..., struct{int ButtonNum;int Value})
|