Rev 1629 | Rev 1649 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1629 | Rev 1634 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | 1, |
38 | 1, |
39 | cuda_cmds |
39 | cuda_cmds |
40 | }; |
40 | }; |
41 | 41 | ||
42 | 42 | ||
- | 43 | #define SPECIAL 255 |
|
- | 44 | #define FUNCTION_KEYS 0x100 |
|
- | 45 | ||
- | 46 | ||
43 | static char lchars[0x80] = { |
47 | static int lchars[0x80] = { |
- | 48 | 'a', |
|
- | 49 | 's', |
|
- | 50 | 'd', |
|
- | 51 | 'f', |
|
- | 52 | 'h', |
|
- | 53 | 'g', |
|
- | 54 | 'z', |
|
- | 55 | 'x', |
|
- | 56 | 'c', |
|
- | 57 | 'v', |
|
- | 58 | SPECIAL, |
|
- | 59 | 'b', |
|
- | 60 | 'q', |
|
- | 61 | 'w', |
|
- | 62 | 'e', |
|
- | 63 | 'r', |
|
- | 64 | 'y', |
|
- | 65 | 't', |
|
- | 66 | '1', |
|
- | 67 | '2', |
|
- | 68 | '3', |
|
- | 69 | '4', |
|
- | 70 | '6', |
|
- | 71 | '5', |
|
- | 72 | '=', |
|
- | 73 | '9', |
|
- | 74 | '7', |
|
- | 75 | '-', |
|
- | 76 | '8', |
|
- | 77 | '0', |
|
- | 78 | ']', |
|
- | 79 | 'o', |
|
- | 80 | 'u', |
|
- | 81 | '[', |
|
- | 82 | 'i', |
|
- | 83 | 'p', |
|
- | 84 | '\n', /* Enter */ |
|
- | 85 | 'l', |
|
- | 86 | 'j', |
|
- | 87 | '\'', |
|
- | 88 | 'k', |
|
- | 89 | ';', |
|
- | 90 | '\\', |
|
- | 91 | ',', |
|
- | 92 | '/', |
|
- | 93 | 'n', |
|
- | 94 | 'm', |
|
- | 95 | '.', |
|
- | 96 | '\t', /* Tab */ |
|
- | 97 | ' ', |
|
- | 98 | '`', |
|
- | 99 | '\b', /* Backspace */ |
|
- | 100 | SPECIAL, |
|
- | 101 | SPECIAL, /* Escape */ |
|
- | 102 | SPECIAL, /* Ctrl */ |
|
- | 103 | SPECIAL, /* Alt */ |
|
- | 104 | SPECIAL, /* Shift */ |
|
- | 105 | SPECIAL, /* Caps-Lock */ |
|
- | 106 | SPECIAL, /* RAlt */ |
|
- | 107 | SPECIAL, /* Left */ |
|
- | 108 | SPECIAL, /* Right */ |
|
- | 109 | SPECIAL, /* Down */ |
|
- | 110 | SPECIAL, /* Up */ |
|
- | 111 | SPECIAL, |
|
- | 112 | SPECIAL, |
|
- | 113 | '.', /* Keypad . */ |
|
- | 114 | SPECIAL, |
|
- | 115 | '*', /* Keypad * */ |
|
- | 116 | SPECIAL, |
|
44 | 'a', 's', 'd', 'f', 'h', 'g', 'z', 'x', 'c', 'v', 0, 'b', 'q', 'w', 'e', 'r', |
117 | '+', /* Keypad + */ |
- | 118 | SPECIAL, |
|
- | 119 | SPECIAL, /* NumLock */ |
|
- | 120 | SPECIAL, |
|
- | 121 | SPECIAL, |
|
- | 122 | SPECIAL, |
|
45 | 'y', 't', '1', '2', '3', '4', '6', '5', '=', '9', '7', '-', '8', '0', ']', 'o', |
123 | '/', /* Keypad / */ |
46 | 'u', '[', 'i', 'p', 13, 'l', 'j', '\'', 'k', ';', '\\', ',', '/', 'n', 'm', '.', |
124 | '\n', /* Keypad Enter */ |
- | 125 | SPECIAL, |
|
47 | 9, 32, '`', 8, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
126 | '-', /* Keypad - */ |
- | 127 | SPECIAL, |
|
- | 128 | SPECIAL, |
|
- | 129 | SPECIAL, |
|
48 | 0, '.', 0, '*', 0, '+', 0, 0, 0, 0, 0, '/', 13, 0, '-', 0, |
130 | '0', /* Keypad 0 */ |
- | 131 | '1', /* Keypad 1 */ |
|
- | 132 | '2', /* Keypad 2 */ |
|
- | 133 | '3', /* Keypad 3 */ |
|
49 | 0, 0, '0', '1', '2', '3', '4', '5', '6', '7', 0, '8', '9', 0, 0, 0, |
134 | '4', /* Keypad 4 */ |
- | 135 | '5', /* Keypad 5 */ |
|
- | 136 | '6', /* Keypad 6 */ |
|
- | 137 | '7', /* Keypad 7 */ |
|
- | 138 | SPECIAL, |
|
50 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
139 | '8', /* Keypad 8 */ |
51 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
140 | '9', /* Keypad 9 */ |
- | 141 | SPECIAL, |
|
- | 142 | SPECIAL, |
|
- | 143 | SPECIAL, |
|
- | 144 | (FUNCTION_KEYS | 5), /* F5 */ |
|
- | 145 | (FUNCTION_KEYS | 6), /* F6 */ |
|
- | 146 | (FUNCTION_KEYS | 7), /* F7 */ |
|
- | 147 | (FUNCTION_KEYS | 3), /* F3 */ |
|
- | 148 | (FUNCTION_KEYS | 8), /* F8 */ |
|
- | 149 | (FUNCTION_KEYS | 9), /* F9 */ |
|
- | 150 | SPECIAL, |
|
- | 151 | (FUNCTION_KEYS | 11), /* F11 */ |
|
- | 152 | SPECIAL, |
|
- | 153 | (FUNCTION_KEYS | 13), /* F13 */ |
|
- | 154 | SPECIAL, |
|
- | 155 | SPECIAL, /* ScrollLock */ |
|
- | 156 | SPECIAL, |
|
- | 157 | (FUNCTION_KEYS | 10), /* F10 */ |
|
- | 158 | SPECIAL, |
|
- | 159 | (FUNCTION_KEYS | 12), /* F12 */ |
|
- | 160 | SPECIAL, |
|
- | 161 | SPECIAL, /* Pause */ |
|
- | 162 | SPECIAL, /* Insert */ |
|
- | 163 | SPECIAL, /* Home */ |
|
- | 164 | SPECIAL, /* PageUp */ |
|
- | 165 | SPECIAL, /* Delete */ |
|
- | 166 | (FUNCTION_KEYS | 4), /* F4 */ |
|
- | 167 | SPECIAL, /* End */ |
|
- | 168 | (FUNCTION_KEYS | 2), /* F2 */ |
|
- | 169 | SPECIAL, /* PageDown */ |
|
- | 170 | (FUNCTION_KEYS | 1) /* F1 */ |
|
52 | }; |
171 | }; |
53 | 172 | ||
54 | 173 | ||
55 | int kbd_arch_init(void) |
174 | int kbd_arch_init(void) |
56 | { |
175 | { |
Line 58... | Line 177... | ||
58 | } |
177 | } |
59 | 178 | ||
60 | 179 | ||
61 | int kbd_arch_process(keybuffer_t *keybuffer, int scan_code) |
180 | int kbd_arch_process(keybuffer_t *keybuffer, int scan_code) |
62 | { |
181 | { |
- | 182 | if (scan_code != -1) { |
|
63 | uint8_t scancode = (uint8_t) scan_code; |
183 | uint8_t scancode = (uint8_t) scan_code; |
64 | 184 | ||
65 | if ((scancode != 0) && ((scancode & 0x80) != 0x80)) |
185 | if ((scancode & 0x80) != 0x80) { |
66 | keybuffer_push(keybuffer, lchars[scancode & 0x7f]); |
186 | int key = lchars[scancode & 0x7f]; |
- | 187 | ||
- | 188 | if (key != SPECIAL) |
|
- | 189 | keybuffer_push(keybuffer, key); |
|
- | 190 | } |
|
- | 191 | } |
|
67 | 192 | ||
68 | return 1; |
193 | return 1; |
69 | } |
194 | } |