From 92b1cffde6ac53a71e729fbff464afd60299e1db Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Tue, 31 Oct 2017 02:27:45 +0000 Subject: [PATCH] Added scancodes for set one up to 0x0F. --- kernel/arch/i386/ps2.nim | 2 +- kernel/arch/i386/scancodes.nim | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 kernel/arch/i386/scancodes.nim diff --git a/kernel/arch/i386/ps2.nim b/kernel/arch/i386/ps2.nim index 21c2247..6c703fe 100644 --- a/kernel/arch/i386/ps2.nim +++ b/kernel/arch/i386/ps2.nim @@ -3,7 +3,7 @@ import io const keyboardAddress = 0x60 type - KeypressEvent = tuple + KeypressEvent* = tuple character: char pressed: bool diff --git a/kernel/arch/i386/scancodes.nim b/kernel/arch/i386/scancodes.nim new file mode 100644 index 0000000..8a7700d --- /dev/null +++ b/kernel/arch/i386/scancodes.nim @@ -0,0 +1,13 @@ +import tables + +type + KeypressEvent* = tuple + character: char + pressed: bool + +const SetOne* = { + 0x01:('\x1B', true), 0x02:('1', true), 0x03:('2', true), 0x04:('3', true), + 0x05:('4', true), 0x06:('5', true), 0x07:('6', true), 0x08:('7', true), + 0x09:('8', true), 0x0A:('9', true), 0x0B:('0', true), 0x0C:('-', true), + 0x0D:('=', true), 0x0E:('\x08', true), 0x0F:('\x09', true) +}.newTable