/**\r
* \file tpl_drv_keyboard.h\r
* \brief Keyboard Driver Interface Definitions\r
-*/\r
+ * \author John Hodge (thePowersGang)\r
+ * \r
+ * \section dirs VFS Layout\r
+ * Keyboard drivers consist of only a single node, which is a normal file\r
+ * node with a size of zero. All reads and writes to this node are ignored\r
+ * (tVFS_Node.Read and tVFS_Node.Write are NULL)\r
+ */\r
#ifndef _TPL_KEYBOARD_H\r
#define _TPL_KEYBOARD_H\r
\r
* \extends eTplDrv_IOCtl\r
*/\r
enum eTplKeyboard_IOCtl {\r
- //! \brief Get/Set Repeat Rate - (int Rate)\r
+ /**\r
+ * ioctl(..., int *Rate)\r
+ * \brief Get/Set Repeat Rate\r
+ * \param Rate New repeat rate (pointer)\r
+ * \return Current/New Repeat rate\r
+ * \r
+ * Gets/Set the repeat rate (actually the time in miliseconds between\r
+ * repeats) of a held down key.\r
+ * If the rate is set to zero, repeating will be disabled.\r
+ */\r
KB_IOCTL_REPEATRATE = 4,\r
- //! \brief Get/Set Repeat Delay - (int Delay)\r
+ \r
+ /**\r
+ * ioctl(..., int *Delay)\r
+ * \brief Get/Set Repeat Delay\r
+ * \param Delay New repeat delay (pointer)\r
+ * \return Current/New repeat delay\r
+ * \r
+ * Gets/Set the time in miliseconds before a key starts repeating\r
+ * after a key is pressed.\r
+ * Setting the delay to a negative number will cause the function to\r
+ * return -1\r
+ */\r
KB_IOCTL_REPEATDELAY,\r
- //! \brief Sets the callback\r
+ \r
+ \r
+ /**\r
+ * ioctl(..., tKeybardCallback *Callback)\r
+ * \brief Sets the callback\r
+ * \note Can be called from kernel mode only\r
+ * \r
+ * Sets the function to be called when a key event occurs (press, release\r
+ * or repeat). This function pointer must be in kernel mode (although,\r
+ * kernel->user or kernel->ring3driver abstraction functions can be used)\r
+ */\r
KB_IOCTL_SETCALLBACK\r
};\r
\r
/**\r
* \brief Callback type for KB_IOCTL_SETCALLBACK\r
+ * \param Key Unicode character code for the pressed key (with bit 31\r
+ * set if the key is released)\r
*/\r
typedef void (*tKeybardCallback)(Uint32 Key);\r
\r
/**\r
* \brief Symbolic key codes\r
+ * \r
+ * These key codes represent non-pritable characters and are placed above\r
+ * the Unicode character space.\r
+ * If the using driver recieves a key code with the 31st bit set, it means\r
+ * that that key has been released.\r
*/\r
enum eTplKeyboard_KeyCodes {\r
- KEY_ESC = 0x1B,\r
+ KEY_ESC = 0x1B, //!< Escape Character\r
\r
- KEY_NP_MASK = 0x80, //End of ASCII Range\r
+ KEY_NP_MASK = 0x40000000, //! Mask for non-printable characters\r
\r
+ /**\r
+ * \name Special Keys\r
+ * \brief These keys are usually used on their own\r
+ * \{\r
+ */\r
KEY_CAPSLOCK,\r
KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT,\r
KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, \r
KEY_KPHOME, KEY_KPUP, KEY_KPPGUP, KEY_KPLEFT, KEY_KP5, KEY_KPRIGHT,\r
KEY_KPEND, KEY_KPDOWN, KEY_KPPGDN, KEY_KPINS, KEY_KPDEL,\r
KEY_WIN, KEY_MENU,\r
+ /**\r
+ * \}\r
+ */\r
\r
// Modifiers\r
- KEY_MODIFIERS = 0xC0,\r
+ /**\r
+ * \name Modifiers\r
+ * \brief These keye usually alter the character stream sent to the user\r
+ * \{\r
+ */\r
+ KEY_MODIFIERS = 0x60000000,\r
KEY_LCTRL, KEY_RCTRL,\r
KEY_LALT, KEY_RALT,\r
KEY_LSHIFT, KEY_RSHIFT,\r
- \r
- KEY_KEYUP = 0xFF\r
+ /**\r
+ * \}\r
+ */\r
};\r
\r
\r