X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Ftpl_drv_joystick.h;h=2f4249b8bfd06d79b8bcf0a676c1bed779aa69ab;hb=7c5a60c8be053f65ecceb47be773ea21a050b186;hp=888d4ac13bfa91dce6f66008628a9d10eabff50c;hpb=1bd380e56add4d1487232b1051ac19ec142f63f1;p=tpg%2Facess2.git diff --git a/Kernel/include/tpl_drv_joystick.h b/Kernel/include/tpl_drv_joystick.h index 888d4ac1..2f4249b8 100644 --- a/Kernel/include/tpl_drv_joystick.h +++ b/Kernel/include/tpl_drv_joystick.h @@ -28,13 +28,17 @@ */ enum eTplJoystick_IOCtl { /** - * ioctl(..., tJoystickCallback *Callback) + * ioctl(..., tJoystick_Callback *Callback) * \brief Sets the callback * \note Can be called from kernel mode only * * 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) + * + * Axis events depend on the axis limit, if non-zero, the callback fires + * if the cursor position changes. Otherwise it fires when the axis value + * (cursor accelleration) changes. */ JOY_IOCTL_SETCALLBACK = 4, @@ -113,16 +117,23 @@ struct sJoystick_FileHeader * \brief Axis Definition in file data * * Describes the current state of an axis on the joystick. - * \a MinValue and \a MaxValue describe the valid range for \a CurValue - * While \a CurState is between zero and the current limit set by the - * JOY_IOCTL_GETSETAXISLIMIT IOCtl. + * \a CursorPos is between zero and the current limit set by the + * JOY_IOCTL_GETSETAXISLIMIT IOCtl, while \a CurValue indicates the + * current position of the joystick axis. This is defined to be between + * \a MinValue and \a MaxValue. */ struct sJoystick_Axis { Sint16 MinValue; //!< Minumum value for \a CurValue Sint16 MaxValue; //!< Maximum value for \a CurValue Sint16 CurValue; //!< Current value (joystick position) - Uint16 CurState; //!< Current state (cursor position) + Uint16 CursorPos; //!< Current state (cursor position) }; +#define JOY_INFOSTRUCT(_naxies, _nbuttons) struct { \ + Uint16 NAxies, NButtons;\ + tJoystick_Axis Axies[_naxies];\ + Uint16 Buttons[_nbuttons];\ + } + #endif