8 #include <api_drv_common.h>
9 #include <api_drv_keyboard.h>
10 #include <Input/Keyboard/include/keyboard.h>
11 #include "kb_transtab.h"
14 #define KB_BUFFER_SIZE 1024
15 #define USE_KERNEL_MAGIC 1
18 int KB_Install(char **Arguments);
19 void KB_HandleScancode(Uint8 scancode);
20 void KB_UpdateLEDs(void);
21 int KB_IOCtl(tVFS_Node *Node, int Id, void *Data);
26 tKeyboard *gPS2Kb_Info;
30 * \brief Install the keyboard driver
32 int KB_Install(char **Arguments)
34 gPS2Kb_Info = Keyboard_CreateInstance(KEYSYM_RIGHTGUI, "PS2Keyboard");
39 * \brief Called on a keyboard IRQ
40 * \param IRQNum IRQ number (unused)
42 void KB_HandleScancode(Uint8 scancode)
47 if(scancode == 0xFA) return;
50 if(scancode == 0xE0) {
55 if(scancode == 0xE1) {
74 hidcode = gp101_to_HID[giPS2Kb_Layer][scancode];
77 Log_Warning("PS2Kb", "Unknown scancode %i:0x%x %s", giPS2Kb_Layer, scancode,
78 gbPS2Kb_KeyUp ? "release" : "press"
81 else if( hidcode == -1 )
83 // Ignored (Fake shift)
88 Keyboard_HandleKey( gPS2Kb_Info, (1 << 31) | hidcode );
90 Keyboard_HandleKey( gPS2Kb_Info, (0 << 31) | hidcode );
98 * \fn void KB_UpdateLEDs(void)
99 * \brief Updates the status of the keyboard LEDs
101 void KB_UpdateLEDs(void)
105 // leds = (gbKB_CapsState ? 4 : 0);
108 Log_Warning("Keyboard", "TODO: Update LEDs");