Merge branch 'master' of git://cadel.mutabah.net/acess2
[tpg/acess2.git] / KernelLand / Modules / Input / Keyboard / include / keyboard.h
1 /*
2  * Acess2 Kernel - Keyboard mulitplexer/translation
3  * - By John Hodge (thePowersGang)
4  *
5  * keyboard.h
6  * - Interface header
7  */
8 #ifndef _KEYBOARD__KEYBOARD_H_
9 #define _KEYBOARD__KEYBAORD_H_
10
11 #include <api_drv_keyboard.h>
12
13 /**
14  * \brief Keyboard instance
15  *
16  * Used to refer to a keyboard state (current key states, keymap and destination
17  * node)
18  */
19 typedef struct sKeyboard        tKeyboard;
20
21 /**
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
26  * 
27  * The \a MaxSym parameter is used to create a bitmap of key states
28  */
29 extern tKeyboard        *Keyboard_CreateInstance(int MaxSym, const char *Ident);
30 /**
31  * \brief De-register and free a keyboard instance
32  * \param Instance      Value returned by Keyboard_CreateInstance
33  */
34 extern void     Keyboard_RemoveInstance(tKeyboard *Instance);
35 /**
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
39  *
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)
44  */
45 extern void     Keyboard_HandleKey(tKeyboard *Instance, Uint32 HIDKeySym);
46
47 #endif
48

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