Kernel - Fixing vterm bug with 32-bit input, slight fix to keymap
[tpg/acess2.git] / Kernel / include / api_drv_keyboard.h
index 8aa3263..57ca247 100644 (file)
@@ -9,7 +9,7 @@
  * (tVFS_Node.Read and tVFS_Node.Write are NULL)\r
  */\r
 #ifndef _API_DRV_KEYBOARD_H\r
-#define _API_KEYBOARD_H\r
+#define _API_DRV_KEYBOARD_H\r
 \r
 #include <api_drv_common.h>\r
 \r
@@ -53,19 +53,40 @@ 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
 \r
+/**\r
+ * \brief Symbolic names for Keyboard IOCtls\r
+ */\r
 #define DRV_KEYBAORD_IOCTLNAMES        "getset_repeat_rate", "getset_repeat_delay", "set_callback"\r
 \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
@@ -77,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
@@ -95,7 +116,8 @@ enum eTplKeyboard_KeyCodes {
        KEY_KPENTER, KEY_KPSLASH, KEY_KPMINUS, KEY_KPPLUS, KEY_KPSTAR,\r
        KEY_KPHOME, KEY_KPUP, KEY_KPPGUP, KEY_KPLEFT, KEY_KP5, KEY_KPRIGHT,\r
        KEY_KPEND, KEY_KPDOWN, KEY_KPPGDN, KEY_KPINS, KEY_KPDEL,\r
-       KEY_WIN, KEY_MENU,\r
+       KEY_LWIN, KEY_RWIN,\r
+       KEY_MENU,\r
        /**\r
         * \}\r
         */\r
@@ -106,7 +128,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