9 #include <tpl_drv_common.h>
10 #include <tpl_drv_keyboard.h>
14 int NativeKeyboard_Install(char **Arguments);
15 int NativeKeyboard_IOCtl(tVFS_Node *Node, int Id, void *Data);
18 MODULE_DEFINE(0, 0x0100, NativeKeyboard, NativeKeyboard_Install, NULL, NULL);
19 tDevFS_Driver gKB_DevInfo = {
20 NULL, "NativeKeyboard",
24 .IOCtl = NativeKeyboard_IOCtl
30 * \brief Install the keyboard driver
32 int NativeKeyboard_Install(char **Arguments)
34 DevFS_AddDevice( &gKB_DevInfo );
38 static const char * const csaIOCTL_NAMES[] = {
40 DRV_KEYBAORD_IOCTLNAMES,
45 * \fn int KB_IOCtl(tVFS_Node *Node, int Id, void *Data)
46 * \brief Calls an IOCtl Command
48 int NativeKeyboard_IOCtl(tVFS_Node *Node, int Id, void *Data)
52 BASE_IOCTLS(DRV_TYPE_KEYBOARD, "NativeKeyboard", 0x10000, csaIOCTL_NAMES);
54 // Sets the Keyboard Callback
55 case KB_IOCTL_SETCALLBACK:
57 if(Threads_GetUID() != 0)
59 // Can only be set once
60 if(gUI_KeyboardCallback != NULL) return 0;
62 gUI_KeyboardCallback = Data;