Modules/SB16 - Stub driver, nowhere near complete
[tpg/acess2.git] / Kernel / include / tpl_drv_keyboard.h
1 /**\r
2  * \file tpl_drv_keyboard.h\r
3  * \brief Keyboard Driver Interface Definitions\r
4  * \author John Hodge (thePowersGang)\r
5  * \r
6  * \section dirs VFS Layout\r
7  * Keyboard drivers consist of only a single node, which is a normal file\r
8  * node with a size of zero. All reads and writes to this node are ignored\r
9  * (tVFS_Node.Read and tVFS_Node.Write are NULL)\r
10  */\r
11 #ifndef _TPL_KEYBOARD_H\r
12 #define _TPL_KEYBOARD_H\r
13 \r
14 #include <tpl_drv_common.h>\r
15 \r
16 /**\r
17  * \enum eTplKeyboard_IOCtl\r
18  * \brief Common Keyboard IOCtl Calls\r
19  * \extends eTplDrv_IOCtl\r
20  */\r
21 enum eTplKeyboard_IOCtl {\r
22         /**\r
23          * ioctl(..., int *Rate)\r
24          * \brief Get/Set Repeat Rate\r
25          * \param Rate  New repeat rate (pointer)\r
26          * \return Current/New Repeat rate\r
27          * \r
28          * Gets/Set the repeat rate (actually the time in miliseconds between\r
29          * repeats) of a held down key.\r
30          * If the rate is set to zero, repeating will be disabled.\r
31          */\r
32         KB_IOCTL_REPEATRATE = 4,\r
33         \r
34         /**\r
35          * ioctl(..., int *Delay)\r
36          * \brief Get/Set Repeat Delay\r
37          * \param Delay New repeat delay (pointer)\r
38          * \return Current/New repeat delay\r
39          * \r
40          * Gets/Set the time in miliseconds before a key starts repeating\r
41          * after a key is pressed.\r
42          * Setting the delay to a negative number will cause the function to\r
43          * return -1\r
44          */\r
45         KB_IOCTL_REPEATDELAY,\r
46         \r
47         \r
48         /**\r
49          * ioctl(..., tKeybardCallback *Callback)\r
50          * \brief Sets the callback\r
51          * \note Can be called from kernel mode only\r
52          * \r
53          * Sets the function to be called when a key event occurs (press, release\r
54          * or repeat). This function pointer must be in kernel mode (although,\r
55          * kernel->user or kernel->ring3driver abstraction functions can be used)\r
56          */\r
57         KB_IOCTL_SETCALLBACK\r
58 };\r
59 \r
60 #define DRV_KEYBAORD_IOCTLNAMES "getset_repeat_rate", "getset_repeat_delay", "set_callback"\r
61 \r
62 /**\r
63  * \brief Callback type for KB_IOCTL_SETCALLBACK\r
64  * \param Key Unicode character code for the pressed key (with bit 31\r
65  *            set if the key is released)\r
66  */\r
67 typedef void (*tKeybardCallback)(Uint32 Key);\r
68 \r
69 /**\r
70  * \brief Symbolic key codes\r
71  * \r
72  * These key codes represent non-pritable characters and are placed above\r
73  * the Unicode character space.\r
74  * If the using driver recieves a key code with the 31st bit set, it means\r
75  * that that key has been released.\r
76  */\r
77 enum eTplKeyboard_KeyCodes {\r
78         KEY_ESC = 0x1B, //!< Escape Character\r
79         \r
80         KEY_NP_MASK = 0x40000000,       //! Mask for non-printable characters\r
81         \r
82         /**\r
83          * \name Special Keys\r
84          * \brief These keys are usually used on their own\r
85          * \{\r
86          */\r
87         KEY_CAPSLOCK,\r
88         KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT,\r
89         KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, \r
90         KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12,\r
91         KEY_NUMLOCK, KEY_SCROLLLOCK,\r
92         KEY_HOME, KEY_END, KEY_INS, KEY_DEL,\r
93         KEY_PAUSE, KEY_BREAK,\r
94         KEY_PGUP, KEY_PGDOWN,\r
95         KEY_KPENTER, KEY_KPSLASH, KEY_KPMINUS, KEY_KPPLUS, KEY_KPSTAR,\r
96         KEY_KPHOME, KEY_KPUP, KEY_KPPGUP, KEY_KPLEFT, KEY_KP5, KEY_KPRIGHT,\r
97         KEY_KPEND, KEY_KPDOWN, KEY_KPPGDN, KEY_KPINS, KEY_KPDEL,\r
98         KEY_WIN, KEY_MENU,\r
99         /**\r
100          * \}\r
101          */\r
102         \r
103         // Modifiers\r
104         /**\r
105          * \name Modifiers\r
106          * \brief These keye usually alter the character stream sent to the user\r
107          * \{\r
108          */\r
109         KEY_MODIFIERS = 0x60000000,\r
110         KEY_LCTRL, KEY_RCTRL,\r
111         KEY_LALT, KEY_RALT,\r
112         KEY_LSHIFT, KEY_RSHIFT,\r
113         /**\r
114          * \}\r
115          */\r
116 };\r
117 \r
118 \r
119 #endif\r

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