X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Fapi_drv_keyboard.h;h=57ca247e257d190c523c8ac90701e0b7f9413c8f;hb=7536e8afcc3018c4ca2a4aa8f8422cf86a6c188c;hp=8aa326345203473d3654aded4329fd683bc9fcba;hpb=e6795eb552a6be88b7870dae14a958ab391bfae8;p=tpg%2Facess2.git diff --git a/Kernel/include/api_drv_keyboard.h b/Kernel/include/api_drv_keyboard.h index 8aa32634..57ca247e 100644 --- a/Kernel/include/api_drv_keyboard.h +++ b/Kernel/include/api_drv_keyboard.h @@ -9,7 +9,7 @@ * (tVFS_Node.Read and tVFS_Node.Write are NULL) */ #ifndef _API_DRV_KEYBOARD_H -#define _API_KEYBOARD_H +#define _API_DRV_KEYBOARD_H #include @@ -53,19 +53,40 @@ 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 }; +/** + * \brief Symbolic names for Keyboard IOCtls + */ #define DRV_KEYBAORD_IOCTLNAMES "getset_repeat_rate", "getset_repeat_delay", "set_callback" /** * \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 * @@ -77,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 @@ -95,7 +116,8 @@ enum eTplKeyboard_KeyCodes { KEY_KPENTER, KEY_KPSLASH, KEY_KPMINUS, KEY_KPPLUS, KEY_KPSTAR, KEY_KPHOME, KEY_KPUP, KEY_KPPGUP, KEY_KPLEFT, KEY_KP5, KEY_KPRIGHT, KEY_KPEND, KEY_KPDOWN, KEY_KPPGDN, KEY_KPINS, KEY_KPDEL, - KEY_WIN, KEY_MENU, + KEY_LWIN, KEY_RWIN, + KEY_MENU, /** * \} */ @@ -106,7 +128,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,