Mouse driver and AxWin
[tpg/acess2.git] / Kernel / include / tpl_drv_joystick.h
index dd22001..3ba441a 100644 (file)
@@ -28,7 +28,7 @@
  */\r
 enum eTplJoystick_IOCtl {\r
        /**\r
-        * ioctl(..., struct{int Ident;tJoystickCallback *Callback})\r
+        * ioctl(..., tJoystickCallback *Callback)\r
         * \brief Sets the callback\r
         * \note Can be called from kernel mode only\r
         *\r
@@ -39,33 +39,64 @@ enum eTplJoystick_IOCtl {
        JOY_IOCTL_SETCALLBACK = 4,\r
 \r
        /**\r
-        * ioctl(..., struct{int AxisNum;int Value})\r
+        * ioctl(..., int *Argument)\r
+        * \brief Set the argument passed as the first parameter to the callback\r
+        * \note Kernel mode only\r
+        */\r
+       JOY_IOCTL_SETCALLBACKARG,\r
+\r
+       /**\r
+        * ioctl(..., tJoystickNumValue *)\r
         * \brief Set maximum value for sJoystick_Axis.CurState\r
         * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
         */\r
        JOY_IOCTL_GETSETAXISLIMIT,\r
+\r
+       /**\r
+        * ioctl(..., tJoystickNumValue *)\r
+        * \brief Set the value of sJoystick_Axis.CurState\r
+        * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
+        */\r
+       JOY_IOCTL_GETSETAXISPOSITION,\r
        \r
        /**\r
-        * ioctl(..., struct{int AxisNum;int Value})\r
+        * ioctl(..., tJoystickNumValue *)\r
         * \brief Set axis flags\r
         * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
         */\r
        JOY_IOCTL_GETSETAXISFLAGS,\r
 \r
        /**\r
-        * ioctl(..., struct{int ButtonNum;int Value})\r
+        * ioctl(..., tJoystickNumValue *)\r
         * \brief Set Button Flags\r
         * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
         */\r
        JOY_IOCTL_GETSETBUTTONFLAGS,\r
 };\r
 \r
+#define        DRV_JOY_IOCTLNAMES      "set_callback", "set_callback_arg", "getset_axis_limit", "getset_axis_position", \\r
+       "getset_axis_flags", "getset_button_flags"\r
+\r
+// === TYPES ===\r
+typedef struct sJoystick_NumValue      tJoystick_NumValue;\r
+typedef struct sJoystick_FileHeader    tJoystick_FileHeader;\r
+typedef struct sJoystick_Axis  tJoystick_Axis;\r
+\r
+/**\r
+ * \brief Number/Value pair for joystick IOCtls\r
+ */\r
+struct sJoystick_NumValue\r
+{\r
+        int    Num;    //!< Axis/Button number\r
+        int    Value;  //!< Value (see IOCtl defs for meaning)\r
+};\r
+\r
 /**\r
  * \brief Callback type for JOY_IOCTL_SETCALLBACK\r
  * \param Ident        Ident value passed to JOY_IOCTL_SETCALLBACK\r
  * \r
  */\r
-typedef void (*tJoystickCallback)(int Ident, int bIsAxis, int Num, int Delta);\r
+typedef void (*tJoystick_Callback)(int Ident, int bIsAxis, int Num, int Delta);\r
 \r
 /**\r
  * \struct sJoystick_FileHeader\r
@@ -77,7 +108,7 @@ struct sJoystick_FileHeader
 };\r
 \r
 /**\r
- * \brief Axis Definition\r
+ * \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
@@ -87,7 +118,7 @@ struct sJoystick_FileHeader
 struct sJoystick_Axis\r
 {\r
        Sint16  MinValue;       //!< Minumum value for \a CurValue\r
-       Sint16  MaxValue;       //!< Maximum value for \a MaxValue\r
+       Sint16  MaxValue;       //!< Maximum value for \a CurValue\r
        Sint16  CurValue;       //!< Current value (joystick position)\r
        Uint16  CurState;       //!< Current state (cursor position)\r
 };\r

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