Modules/SB16 - Stub driver, nowhere near complete
[tpg/acess2.git] / Kernel / include / tpl_drv_joystick.h
index 888d4ac..2f4249b 100644 (file)
  */\r
 enum eTplJoystick_IOCtl {\r
        /**\r
-        * ioctl(..., tJoystickCallback *Callback)\r
+        * ioctl(..., tJoystick_Callback *Callback)\r
         * \brief Sets the callback\r
         * \note Can be called from kernel mode only\r
         *\r
         * Sets the callback that is called when a event occurs (button or axis\r
         * change). This function pointer must be in kernel mode (although,\r
         * kernel->user or kernel->ring3driver abstraction functions can be used)\r
+        * \r
+        * Axis events depend on the axis limit, if non-zero, the callback fires\r
+        * if the cursor position changes. Otherwise it fires when the axis value\r
+        * (cursor accelleration) changes.\r
         */\r
        JOY_IOCTL_SETCALLBACK = 4,\r
 \r
@@ -113,16 +117,23 @@ struct sJoystick_FileHeader
  * \brief Axis Definition in file data\r
  *\r
  * Describes the current state of an axis on the joystick.\r
- * \a MinValue and \a MaxValue describe the valid range for \a CurValue\r
- * While \a CurState is between zero and the current limit set by the\r
- * JOY_IOCTL_GETSETAXISLIMIT IOCtl.\r
+ * \a CursorPos is between zero and the current limit set by the\r
+ * JOY_IOCTL_GETSETAXISLIMIT IOCtl, while \a CurValue indicates the\r
+ * current position of the joystick axis. This is defined to be between\r
+ * \a MinValue and \a MaxValue.\r
  */\r
 struct sJoystick_Axis\r
 {\r
        Sint16  MinValue;       //!< Minumum value for \a CurValue\r
        Sint16  MaxValue;       //!< Maximum value for \a CurValue\r
        Sint16  CurValue;       //!< Current value (joystick position)\r
-       Uint16  CurState;       //!< Current state (cursor position)\r
+       Uint16  CursorPos;      //!< Current state (cursor position)\r
 };\r
 \r
+#define JOY_INFOSTRUCT(_naxies, _nbuttons) struct { \\r
+       Uint16  NAxies, NButtons;\\r
+       tJoystick_Axis  Axies[_naxies];\\r
+       Uint16  Buttons[_nbuttons];\\r
+       }\r
+\r
 #endif\r

UCC git Repository :: git.ucc.asn.au