Kernel/Keyboard - Changed keyboard API to facilitate the GUI better
[tpg/acess2.git] / Kernel / include / api_drv_keyboard.h
index 58eafb9..2085df6 100644 (file)
@@ -53,6 +53,10 @@ enum eTplKeyboard_IOCtl {
         * Sets the function to be called when a key event occurs (press, release\r
         * or repeat). This function pointer must be in kernel mode (although,\r
         * kernel->user or kernel->ring3driver abstraction functions can be used)\r
+        *\r
+        * This function is called when a key is pressed, repeated or released.\r
+        * If the raw scancode is to be included with the key event, it should precede\r
+        * the event.\r
         */\r
        KB_IOCTL_SETCALLBACK\r
 };\r
@@ -64,11 +68,25 @@ enum eTplKeyboard_IOCtl {
 \r
 /**\r
  * \brief Callback type for KB_IOCTL_SETCALLBACK\r
- * \param Key Unicode character code for the pressed key (with bit 31\r
- *            set if the key is released)\r
+ * \param Key  Key symbol (Unicode or eTplKeyboard_KeyCodes)\r
  */\r
 typedef void (*tKeybardCallback)(Uint32 Key);\r
 \r
+/**\r
+ * \name Callback key flags\r
+ * \brief Flags for values passed to the callback\r
+ * \{\r
+ */\r
+#define KEY_CODEPOINT_MASK     0x3FFFFFFF\r
+#define KEY_ACTION_MASK        0xC0000000\r
+#define KEY_ACTION_PRESS       0x00000000      //!< Key pressed\r
+#define KEY_ACTION_RELEASE     0x40000000      //!< Key released\r
+#define KEY_ACTION_REFIRE      0x80000000      //!< Repeated key\r
+#define KEY_ACTION_RAWSYM      0xC0000000      //!< Raw key symbol (comes before a press/repeat/release)\r
+/**\r
+ * \}\r
+ */\r
+\r
 /**\r
  * \brief Symbolic key codes\r
  * \r
@@ -80,7 +98,7 @@ typedef void (*tKeybardCallback)(Uint32 Key);
 enum eTplKeyboard_KeyCodes {\r
        KEY_ESC = 0x1B, //!< Escape Character\r
        \r
-       KEY_NP_MASK = 0x40000000,       //! Mask for non-printable characters\r
+       KEY_NP_MASK = 0x20000000,       //! Mask for non-printable characters\r
        \r
        /**\r
         * \name Special Keys\r
@@ -109,7 +127,7 @@ enum eTplKeyboard_KeyCodes {
         * \brief These keye usually alter the character stream sent to the user\r
         * \{\r
         */\r
-       KEY_MODIFIERS = 0x60000000,\r
+       KEY_MODIFIERS = 0x30000000,\r
        KEY_LCTRL, KEY_RCTRL,\r
        KEY_LALT, KEY_RALT,\r
        KEY_LSHIFT, KEY_RSHIFT,\r

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