X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=Kernel%2Finclude%2Fapi_drv_keyboard.h;h=2085df6682cbc40f10212b80e4e2c03e0bba50b2;hb=c8a4887d3ccd366dc84bfcb31ffff843e4b2c59f;hp=58eafb9ea411ebad6ea78aa435633bfa72706569;hpb=b1488ae9beae34068d38d00e191b90ef0bf812f3;p=tpg%2Facess2.git diff --git a/Kernel/include/api_drv_keyboard.h b/Kernel/include/api_drv_keyboard.h index 58eafb9e..2085df66 100644 --- a/Kernel/include/api_drv_keyboard.h +++ b/Kernel/include/api_drv_keyboard.h @@ -53,6 +53,10 @@ enum eTplKeyboard_IOCtl { * Sets the function to be called when a key event occurs (press, release * or repeat). This function pointer must be in kernel mode (although, * kernel->user or kernel->ring3driver abstraction functions can be used) + * + * This function is called when a key is pressed, repeated or released. + * If the raw scancode is to be included with the key event, it should precede + * the event. */ KB_IOCTL_SETCALLBACK }; @@ -64,11 +68,25 @@ enum eTplKeyboard_IOCtl { /** * \brief Callback type for KB_IOCTL_SETCALLBACK - * \param Key Unicode character code for the pressed key (with bit 31 - * set if the key is released) + * \param Key Key symbol (Unicode or eTplKeyboard_KeyCodes) */ typedef void (*tKeybardCallback)(Uint32 Key); +/** + * \name Callback key flags + * \brief Flags for values passed to the callback + * \{ + */ +#define KEY_CODEPOINT_MASK 0x3FFFFFFF +#define KEY_ACTION_MASK 0xC0000000 +#define KEY_ACTION_PRESS 0x00000000 //!< Key pressed +#define KEY_ACTION_RELEASE 0x40000000 //!< Key released +#define KEY_ACTION_REFIRE 0x80000000 //!< Repeated key +#define KEY_ACTION_RAWSYM 0xC0000000 //!< Raw key symbol (comes before a press/repeat/release) +/** + * \} + */ + /** * \brief Symbolic key codes * @@ -80,7 +98,7 @@ typedef void (*tKeybardCallback)(Uint32 Key); enum eTplKeyboard_KeyCodes { KEY_ESC = 0x1B, //!< Escape Character - KEY_NP_MASK = 0x40000000, //! Mask for non-printable characters + KEY_NP_MASK = 0x20000000, //! Mask for non-printable characters /** * \name Special Keys @@ -109,7 +127,7 @@ enum eTplKeyboard_KeyCodes { * \brief These keye usually alter the character stream sent to the user * \{ */ - KEY_MODIFIERS = 0x60000000, + KEY_MODIFIERS = 0x30000000, KEY_LCTRL, KEY_RCTRL, KEY_LALT, KEY_RALT, KEY_LSHIFT, KEY_RSHIFT,