From: Alan Cox Date: Sun, 4 Jan 2015 17:37:40 +0000 (+0000) Subject: nc100: use the new keyboard defines X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6d266138399bab8daada116e29ce65e5b36f13b8;p=FUZIX.git nc100: use the new keyboard defines --- diff --git a/Kernel/platform-nc100/config.h b/Kernel/platform-nc100/config.h index 26170e38..561e3f76 100644 --- a/Kernel/platform-nc100/config.h +++ b/Kernel/platform-nc100/config.h @@ -19,6 +19,8 @@ #undef CONFIG_SINGLETASK /* Video terminal, not a serial tty */ #define CONFIG_VT +/* We have a key that needs remapping into unicode space */ +#define CONFIG_UNIKEY /* We use flexible 16K banks so use the helper */ #define CONFIG_BANK16 #define MAX_MAPS 16 diff --git a/Kernel/platform-nc100/devtty.c b/Kernel/platform-nc100/devtty.c index 89a85153..218479d7 100644 --- a/Kernel/platform-nc100/devtty.c +++ b/Kernel/platform-nc100/devtty.c @@ -186,54 +186,54 @@ static void keyproc(void) } #ifdef CONFIG_NC200 -static uint8_t keyboard[10][8] = { - {0, 0, 0, 10, '?' /*left */ ,'4', 0, 0}, +uint8_t keyboard[10][8] = { + {0, 0, 0, 10, KEY_LEFT ,'4', 0, 0}, {'9', 0, 0, 0, ' ', 27, 0,/*ctrl*/ 0/*func*/}, {0, '6', 0, '5', '\t', '1', 0/*sym*/, 0/*capslock*/}, {'d', 's', 0, 'e', 'w', 'q', '2', '3'}, {'f', 'r', 0, 'a', 'x', 'z', '7', '8'}, {'c', 'g', 'y', 't', 'v', 'b', 0, 0}, - {'n', 'h', '/', '#', '?' /*right */ , 127, '?' /*down */ , '6'}, - {'k', 'm', 'u', 0, '?' /*up */ , '\\', '=', 0}, + {'n', 'h', '/', '#', KEY_RIGHT , KEY_DEL, KEY_DOWN , '6'}, + {'k', 'm', 'u', 0, KEY_UP , '\\', '=', 0}, {',', 'j', 'i', '\'', '[', ']', '-', 0}, {'.', 'o', 'l', ';', 'p', 8, '0', 0} }; -static uint8_t shiftkeyboard[10][8] = { - {0, 0, 0, 10, '?' /*left */ , '$', 0, 0}, +uint8_t shiftkeyboard[10][8] = { + {0, 0, 0, 10, KEY_LEFT , '$', 0, 0}, {'(', 0, 0, 0, ' ', 3, 0, 0}, {0, '^', 0, '%', '\t', '!', 0, 0}, - {'D', 'S', 0, 'E', 'W', 'Q', '"', '?' /* pound */ }, + {'D', 'S', 0, 'E', 'W', 'Q', '"', KEY_POUND }, {'F', 'R', 0, 'A', 'X', 'Z', '&', '*'}, {'C', 'G', 'Y', 'T', 'V', 'B', 0, 0}, - {'N', 'H', '?', '~', '?' /*right */ , 127, '?' /*down */ , '^'}, - {'K', 'M', 'U', 0, '?' /*up */ , '|', '+', 0}, + {'N', 'H', '?', '~', '?' KEY_RIGHT , 127, KEY_DOWN , '^'}, + {'K', 'M', 'U', 0, '?' KEY_UP , '|', '+', 0}, {'<', 'J', 'I', '@', '{', '}', '_', 0}, {'>', 'O', 'L', ':', 'P', 8, ')', 0 } }; #else -static uint8_t keyboard[10][8] = { - {0, 0, 0, 10, '?' /*left */ , 0, 0, 0}, +uint8_t keyboard[10][8] = { + {0, 0, 0, 10, KEY_LEFT, 0, 0, 0}, {0, '5', 0, 0, ' ', 27, 0, 0}, {0, 0, 0, 0, '\t', '1', 0, 0}, {'d', 's', 0, 'e', 'w', 'q', '2', '3'}, {'f', 'r', 0, 'a', 'x', 'z', 0, '4'}, {'c', 'g', 'y', 't', 'v', 'b', 0, 0}, - {'n', 'h', '/', '#', '?' /*right */ , 127, '?' /*down */ , '6'}, - {'k', 'm', 'u', 0, '?' /*up */ , '\\', '7', '='}, + {'n', 'h', '/', '#', KEY_RIGHT , 127, KEY_DOWN , '6'}, + {'k', 'm', 'u', 0, KEY_UP , '\\', '7', '='}, {',', 'j', 'i', '\'', '[', ']', '-', '8'}, {'.', 'o', 'l', ';', 'p', 8, '9', '0'} }; -static uint8_t shiftkeyboard[10][8] = { - {0, 0, 0, 10, '?' /*left */ , 0, 0, 0}, +uint8_t shiftkeyboard[10][8] = { + {0, 0, 0, 10, KEY_LEFT , 0, 0, 0}, {0, '%', 0, 0, ' ', 3, 0, 0}, {0, 0, 0, 0, '\t', '!', 0, 0}, - {'D', 'S', 0, 'E', 'W', 'Q', '"', '?' /* pound */ }, + {'D', 'S', 0, 'E', 'W', 'Q', '"', KEY_POUND }, {'F', 'R', 0, 'A', 'X', 'Z', 0, '$'}, {'C', 'G', 'Y', 'T', 'V', 'B', 0, 0}, - {'N', 'H', '?', '~', '?' /*right */ , 127, '?' /*down */ , '^'}, - {'K', 'M', 'U', 0, '?' /*up */ , '|', '&', '+'}, + {'N', 'H', '?', '~', KEY_RIGHT , 127, '?' KEY_DOWN , '^'}, + {'K', 'M', 'U', 0, KEY_UP, '|', '&', '+'}, {'<', 'J', 'I', '@', '{', '}', '_', '*'}, {'>', 'O', 'L', ':', 'P', 8, '(', ')'} }; diff --git a/Kernel/platform-nc100/devtty.h b/Kernel/platform-nc100/devtty.h index 9c94fc90..57aed400 100644 --- a/Kernel/platform-nc100/devtty.h +++ b/Kernel/platform-nc100/devtty.h @@ -8,5 +8,7 @@ extern void nc100_tty_init(void); extern uint8_t keymap[10]; #define KEY_ROWS 10 #define KEY_COLS 8 +extern uint8_t keyboard[8][10]; +extern uint8_t shiftkeyboard[8][10]; #endif