summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-10-13 00:57:28 +0200
committerMiguel <m.i@gmx.at>2018-10-13 00:57:28 +0200
commit279f3336a8f6b31ca38bdd272c73aebd68fa88fe (patch)
treeb4bb4a21a4acf38eb810768ac6c1b099e2f18a58 /driver
parentb461c3558b2fe765a4bac512638b0acf5185b4bb (diff)
ncurses arrow keys working etc
Diffstat (limited to 'driver')
-rw-r--r--driver/keyboard.c56
1 files changed, 53 insertions, 3 deletions
diff --git a/driver/keyboard.c b/driver/keyboard.c
index 87cd7d7..b333b78 100644
--- a/driver/keyboard.c
+++ b/driver/keyboard.c
@@ -24,7 +24,6 @@ int hex_to_dec(char c)
{
if(c>='0'&&c<='9')return c-'0';
return c+10-'a';
-
}
extern struct netdev e1000_dev;
@@ -50,7 +49,6 @@ bool keyboard_worker()
return wake;
}
-
void keyboard_init()
{
kb_in=ringbuffer_init(1);// 4096 bytes ringbuffer;
@@ -59,6 +57,52 @@ void keyboard_init()
void keyboard_handle(uint8_t in)
{
+ static bool last_e0=false;
+
+ if(last_e0)
+ {
+ last_e0=false;
+ if(in==0x50)//down
+ {
+ x86_cli();
+ put(27);
+ put('v');
+ x86_sti();
+ }
+ if(in==0x4b)//left
+ {
+ x86_cli();
+ put(27);
+ put('<');
+ x86_sti();
+ }
+ if(in==0x4d)//right
+ {
+ x86_cli();
+ put(27);
+ put('>');
+ x86_sti();
+ }
+ if(in==0x48)//up
+ {
+ x86_cli();
+ put(27);
+ put('a');
+ x86_sti();
+ }
+
+
+
+ return;
+ }
+
+ if(in==0xe0)
+ {
+ last_e0=true;
+ return;
+ }
+
+ last_e0=false;
// klog("kb_in 0x%x",in);
uint8_t make_alpha[]={
0x1e, // A
@@ -132,7 +176,7 @@ void keyboard_handle(uint8_t in)
0x8a, // 9
};
-
+// http://stanislavs.org/helppc/make_codes.html
uint8_t break_key_enter=0x9c;
uint8_t break_key_space=0xb9;
uint8_t break_key_backspace=0x8e;
@@ -210,6 +254,12 @@ void keyboard_handle(uint8_t in)
if(shift_l||shift_r||capslock) ascii='_';
match=true;
}
+ else if(in==0xa7)
+ {
+ ascii=';';
+ if(shift_l||shift_r||capslock) ascii=':';
+ match=true;
+ }
else if(in==0x9A)
{
ascii='[';