2 * Acess2 Kernel - Keyboard mulitplexer/translation
3 * - By John Hodge (thePowersGang)
8 #ifndef _KEYBOARD__KEYBOARD_H_
9 #define _KEYBOARD__KEYBAORD_H_
11 #include <api_drv_keyboard.h>
14 * \brief Keyboard instance
16 * Used to refer to a keyboard state (current key states, keymap and destination
19 typedef struct sKeyboard tKeyboard;
22 * \brief Create a keyboard instance
23 * \param MaxSym Maximum key symbol that could be passed to Keyboard_HandleKey
24 * \param Ident Identifier for this keyboard (e.g. "PS2Keyboard")
25 * \return Keyboard instance pointer
27 * The \a MaxSym parameter is used to create a bitmap of key states
29 extern tKeyboard *Keyboard_CreateInstance(int MaxSym, const char *Ident);
31 * \brief De-register and free a keyboard instance
32 * \param Instance Value returned by Keyboard_CreateInstance
34 extern void Keyboard_RemoveInstance(tKeyboard *Instance);
36 * \brief Handle a key press/release event from the driver
37 * \param Instance Keyboard instance returned by Keyboard_CreateInstance
38 * \param HIDKeySym USB HID Key symbol (KEYSYM_* in Kernel/include/keysym.h), bit 31 denotes release
40 * The value in \a HIDKeySym is a USB HID key symbol, but this could come from anywhere.
41 * The topmost bit of the 32-bit value is used to denote the key being released, if it is set
42 * the key state is cleared and a release event is passed along. Otherwise it is set,
43 * and a refire or a press event is passed (depending on the original key state)
45 extern void Keyboard_HandleKey(tKeyboard *Instance, Uint32 HIDKeySym);