9 #include <api_drv_keyboard.h>
13 int NativeKeyboard_Install(char **Arguments);
14 int NativeKeyboard_IOCtl(tVFS_Node *Node, int Id, void *Data);
17 MODULE_DEFINE(0, 0x0100, NativeKeyboard, NativeKeyboard_Install, NULL, NULL);
18 tVFS_NodeType gKB_NodeType = {
19 .IOCtl = NativeKeyboard_IOCtl
21 tDevFS_Driver gKB_DevInfo = {
22 NULL, "NativeKeyboard",
23 { .Type = &gKB_NodeType }
28 * \brief Install the keyboard driver
30 int NativeKeyboard_Install(char **Arguments)
32 DevFS_AddDevice( &gKB_DevInfo );
36 static const char * csaIOCTL_NAMES[] = {
38 DRV_KEYBAORD_IOCTLNAMES,
43 * \fn int KB_IOCtl(tVFS_Node *Node, int Id, void *Data)
44 * \brief Calls an IOCtl Command
46 int NativeKeyboard_IOCtl(tVFS_Node *Node, int Id, void *Data)
50 BASE_IOCTLS(DRV_TYPE_KEYBOARD, "NativeKeyboard", 0x10000, csaIOCTL_NAMES);
52 // Sets the Keyboard Callback
53 case KB_IOCTL_SETCALLBACK:
55 if(Threads_GetUID() != 0)
57 // Can only be set once
58 if(gUI_KeyboardCallback != NULL) return 0;
60 gUI_KeyboardCallback = Data;