aboutsummaryrefslogtreecommitdiff
path: root/kernel/drivers/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/keyboard.c')
-rw-r--r--kernel/drivers/keyboard.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/drivers/keyboard.c b/kernel/drivers/keyboard.c
index 14445d4..854ab3b 100644
--- a/kernel/drivers/keyboard.c
+++ b/kernel/drivers/keyboard.c
@@ -29,6 +29,8 @@ void keyboard_handler()
// TODO: "Merge" scancode to linux keycode?
/* printf("%x %x = %x\n", scancode, state ? 0xe0 : 0, merged); */
+ free(event);
+ event = malloc(sizeof(*event));
event->magic = KEYBOARD_MAGIC;
event->press = (scancode & 0x80) == 0;
event->scancode = event->press ? scancode : scancode & ~0x80;
@@ -54,7 +56,6 @@ void keyboard_rate()
void keyboard_install()
{
//keyboard_rate(); TODO: Fix keyboard rate?
- event = malloc(sizeof(*event));
irq_install_handler(1, keyboard_handler);
}