From: Alan Cox Date: Sun, 4 Jan 2015 17:36:32 +0000 (+0000) Subject: tty: make keyboard maps visible and standard names X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=d13b9c2f10073f72f4eab20567dbd83c34420ac4;p=FUZIX.git tty: make keyboard maps visible and standard names --- diff --git a/Kernel/platform-dragon/devtty.h b/Kernel/platform-dragon/devtty.h index 62655740..14c28c31 100644 --- a/Kernel/platform-dragon/devtty.h +++ b/Kernel/platform-dragon/devtty.h @@ -4,5 +4,7 @@ #define KEY_ROWS 8 #define KEY_COLS 7 extern uint8_t keymap[8]; +extern uint8_t keyboard[8][7]; +extern uint8_t shiftkeyboard[8][7]; #endif diff --git a/Kernel/platform-msx1/devtty.c b/Kernel/platform-msx1/devtty.c index d045d553..e83f618e 100644 --- a/Kernel/platform-msx1/devtty.c +++ b/Kernel/platform-msx1/devtty.c @@ -99,7 +99,7 @@ static void keyproc(void) } } -static uint8_t keyboard[10][8] = { +uint8_t keyboard[10][8] = { {0, 0, 0, 10, '?' /*left */ , 0, 0, 0}, {0, '5', 0, 0, ' ', 27, 0, 0}, {0, 0, 0, 0, '\t', '1', 0, 0}, @@ -112,7 +112,7 @@ static uint8_t keyboard[10][8] = { {'.', 'o', 'l', ';', 'p', 8, '9', '0'} }; -static uint8_t shiftkeyboard[10][8] = { +uint8_t shiftkeyboard[10][8] = { {0, 0, 0, 10, '?' /*left */ , 0, 0, 0}, {0, '%', 0, 0, ' ', 3, 0, 0}, {0, 0, 0, 0, '\t', '!', 0, 0}, diff --git a/Kernel/platform-msx2/devtty.c b/Kernel/platform-msx2/devtty.c index 146530ae..d5f9a517 100644 --- a/Kernel/platform-msx2/devtty.c +++ b/Kernel/platform-msx2/devtty.c @@ -103,7 +103,7 @@ static void keyproc(void) /* TODO: use locale indicator in addr 002c BIOS, for now only international layout */ -static uint8_t keyboard[11][8] = { +uint8_t keyboard[11][8] = { {'0','1','2', '3','4','5','6','7'}, {'8','9','-','=','\\','[',']',';'}, { 0, 0, ',', '.','/',' ','a','b'}, @@ -113,11 +113,11 @@ static uint8_t keyboard[11][8] = { { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, /* f3 f2 f1 code caps graph ctrl shift */ { 0 , 0, 27 , '\t',24 ,8 , 0 , 13}, /* ret select bs stop tab esc f5 f4 */ {32 ,12, 0 , 127, 0 , 0 , 0 , 0 }, /* right down up left del ins home space */ - {'*','+','/','0','1' ,'2','3','4'}, /* numeric keyboard */ - {'5','6','7','8','9' ,'-',',','.'} + {'*','+','/','0','1' ,'2','3','4'}, /* numeric keyboard */ + {'5','6','7','8','9' ,'-',',','.'} }; -static uint8_t shiftkeyboard[11][8] = { +uint8_t shiftkeyboard[11][8] = { {')','!','@', '#','$','%','^','&'}, {'*','(','_','+','|','{','}',':'}, {'"','~','<','>','?',' ','A','B'}, @@ -127,8 +127,8 @@ static uint8_t shiftkeyboard[11][8] = { { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, /* f3 f2 f1 code caps graph ctrl shift */ { 0 , 0, 27 , '\t',24 ,8 , 0 , 13}, /* ret select bs stop tab esc f5 f4 */ {32 ,12, 0 , 127, 0 , 0 , 0 , 0 }, /* right down up left del ins home space */ - {'*','+','/','0','1' ,'2','3','4'}, /* numeric keyboard */ - {'5','6','7','8','9' ,'-',',','.'} + {'*','+','/','0','1' ,'2','3','4'}, /* numeric keyboard */ + {'5','6','7','8','9' ,'-',',','.'} }; static uint8_t capslock = 0; diff --git a/Kernel/platform-msx2/devtty.h b/Kernel/platform-msx2/devtty.h index c0e0d3b2..0382d74d 100644 --- a/Kernel/platform-msx2/devtty.h +++ b/Kernel/platform-msx2/devtty.h @@ -4,6 +4,8 @@ #define KEY_COLS 11 #define KEY_ROWS 8 extern uint8_t keymap[11]; +extern uint8_t keyboard[11][8]; +extern uint8_t shiftkeyboard[11][8]; extern void kbd_interrupt(void); diff --git a/Kernel/platform-mtx/devtty.c b/Kernel/platform-mtx/devtty.c index 1f4522d1..217f6675 100644 --- a/Kernel/platform-mtx/devtty.c +++ b/Kernel/platform-mtx/devtty.c @@ -213,7 +213,7 @@ static void keyproc(void) } } -static uint8_t keyboard[8][10] = { +uint8_t keyboard[8][10] = { {'1', '3', '5', '7', '9' , '-', '\\', 0/*page */, 3/*brk*/, 0/*f1*/}, { 27, '2', '4', '6', '8', '0', '^', 0/*eol*/, 8, 0/*f5*/}, { 0/*ctrl*/, 'w', 'r', 'y', 'i', 'p', '[', 0/*up*/, 9, 0/*f2*/ }, @@ -224,7 +224,7 @@ static uint8_t keyboard[8][10] = { {'z', 'c', 'b', 'm', '.', '_', 0/*ins*/, 0/*cls*/, ' ', 0 /* f4 */ } }; -static uint8_t shiftkeyboard[8][10] = { +uint8_t shiftkeyboard[8][10] = { {'!', '#', '%', '\'', ')' , '=', '|', 0/*page */, 3/*brk*/, 0xF1/*f1*/}, { 27, '"', '$', '&', '(', 0, '~', 0/*eol*/, 8, 0/*f5*/}, { 0/*ctrl*/, 'w', 'r', 'y', 'i', 'p', '{', 0/*up*/, 9, 0xF2/*f2*/ }, diff --git a/Kernel/platform-mtx/devtty.h b/Kernel/platform-mtx/devtty.h index 0812df95..f9a0dd64 100644 --- a/Kernel/platform-mtx/devtty.h +++ b/Kernel/platform-mtx/devtty.h @@ -12,5 +12,7 @@ extern uint8_t curtty; #define KEY_ROWS 8 #define KEY_COLS 16 extern uint16_t keymap[8]; +extern uint8_t keyboard[8][10]; +extern uint8_t shiftkeyboard[8][10]; #endif diff --git a/Kernel/platform-pcw8256/devtty.c b/Kernel/platform-pcw8256/devtty.c index 616afa21..15e26d81 100644 --- a/Kernel/platform-pcw8256/devtty.c +++ b/Kernel/platform-pcw8256/devtty.c @@ -188,7 +188,7 @@ static void keyproc(void) } } -static uint8_t keyboard[12][8] = { +uint8_t keyboard[12][8] = { {'2', '3', '6', '9', 0x81 /* paste */ ,0x91, '0', 0x93 /* F3 */}, {'1', '5', '4', '8', 0x82 /* copy */, 0x83 /* cut */, 0x84 /* PTR */, 0x85 /* EXIT */}, {'+', '@', 0, '7', '>', 13, ']', 127}, @@ -204,7 +204,7 @@ static uint8_t keyboard[12][8] = { }; /* FIXME: shift symbols need double checking */ -static uint8_t shiftkeyboard[12][8] = { +uint8_t shiftkeyboard[12][8] = { {'2', '3', '6', '9', 0x81 /* paste */ ,0x91, '0', 0x93 /* F3 */}, {'1', '5', '4', '8', 0x82 /* copy */, 0x83 /* cut */, 0x84 /* PTR */, 0x85 /* EXIT */}, {'+', 189/*half*/, 0, '7', '`', 13, ']', 127}, diff --git a/Kernel/platform-zx128/devtty.c b/Kernel/platform-zx128/devtty.c index 8331b22d..d7c5b3b5 100644 --- a/Kernel/platform-zx128/devtty.c +++ b/Kernel/platform-zx128/devtty.c @@ -18,7 +18,7 @@ static uint8_t keybyte, keybit; static uint8_t newkey; static int keysdown = 0; -static uint8_t keyboard[8][5] = { +uint8_t keyboard[8][5] = { { ' ', 0, 'm', 'n', 'b' }, { 13, 'l', 'k', 'j', 'h',}, { 'p', 'o', 'i', 'u', 'y',}, @@ -30,7 +30,7 @@ static uint8_t keyboard[8][5] = { }; /* SYMBOL SHIFT MODE */ -static uint8_t keyboard_ss[8][5] = { +uint8_t shiftkeyboard[8][5] = { { ' ', 0, '.', ',', '*' }, { 13, '=', '+', '-', '^',}, { '"', ';', 0 , 0 , 0 ,}, @@ -144,7 +144,7 @@ static void keydecode(void) if (ss) { - c = keyboard_ss[keybyte][keybit]; + c = shiftkeyboard[keybyte][keybit]; } else { c = keyboard[keybyte][keybit]; diff --git a/Kernel/platform-zx128/devtty.h b/Kernel/platform-zx128/devtty.h index 7e5d3c2b..f63df339 100644 --- a/Kernel/platform-zx128/devtty.h +++ b/Kernel/platform-zx128/devtty.h @@ -7,5 +7,7 @@ static void keydecode(void); #define KEY_ROWS 8 #define KEY_COLS 8 extern uint8_t keymap[8]; +extern uint8_t keyboard[8][8]; +extern uint8_t shiftkeyboard[8][8]; #endif