summaryrefslogtreecommitdiff
path: root/driver/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/keyboard.c')
-rw-r--r--driver/keyboard.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/driver/keyboard.c b/driver/keyboard.c
index f2a44ec..8d7c8aa 100644
--- a/driver/keyboard.c
+++ b/driver/keyboard.c
@@ -1,5 +1,5 @@
/// idiots keyboard driver ////
-// http://www.computer-engineering.org/ps2keyboard/scancodes1.html
+// http://www.computer-engineering.org/ps2keyboard/scancodes1.html
#define FOOLOS_MODULE_NAME "keyboard"
#include <stdbool.h>
@@ -10,11 +10,16 @@ static bool shift_l=false;
static bool shift_r=false;
static bool capslock=false;
-static void (*put)(uint8_t c);
+static uint32_t kb_stream;
-void keyboard_init(void (*func)(uint8_t c))
+static void put(uint8_t c)
{
- put=func;
+ syscall_write(kb_stream,&c,1);
+}
+
+void keyboard_init(uint32_t s)
+{
+ kb_stream=s;
}
void keyboard_handle(uint8_t in)
@@ -122,10 +127,10 @@ void keyboard_handle(uint8_t in)
if(break_caps_lock==in)capslock=!capslock;
-
char ascii;
bool match=false;
+
// optimize this!
if(ctrl_l)
{