Changeset 79460ae in mainline for kbd/arch/ia32/src/kbd.c
- Timestamp:
- 2006-05-30T10:40:17Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 44c6d88d
- Parents:
- f25b73d6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kbd/arch/ia32/src/kbd.c
rf25b73d6 r79460ae 29 29 30 30 #include <arch/kbd.h> 31 #include <key_buffer.h>32 31 #include <ipc/ipc.h> 33 32 … … 80 79 ' ', 81 80 SPECIAL, /* 0x3a - CapsLock */ 82 SPECIAL, /* 0x3b - F1 */ 83 SPECIAL, /* 0x3c - F2 */ 84 SPECIAL, /* 0x3d - F3 */ 85 SPECIAL, /* 0x3e - F4 */ 86 SPECIAL, /* 0x3f - F5 */ 87 SPECIAL, /* 0x40 - F6 */ 88 SPECIAL, /* 0x41 - F7 */ 89 SPECIAL, /* 0x42 - F8 */ 90 SPECIAL, /* 0x43 - F9 */ 91 SPECIAL, /* 0x44 - F10 */ 81 0x3b, /* 0x3b - F1 */ 82 // SPECIAL, /* 0x3b - F1 */ 83 0x3c, /* 0x3c - F2 */ 84 // SPECIAL, /* 0x3c - F2 */ 85 0x3d, /* 0x3d - F3 */ 86 // SPECIAL, /* 0x3d - F3 */ 87 0x3e, /* 0x3e - F4 */ 88 // SPECIAL, /* 0x3e - F4 */ 89 // SPECIAL, /* 0x3f - F5 */ 90 0x3f, /* 0x3f - F5 */ 91 // SPECIAL, /* 0x40 - F6 */ 92 0x40, /* 0x40 - F6 */ 93 // SPECIAL, /* 0x41 - F7 */ 94 0x41, /* 0x41 - F7 */ 95 // SPECIAL, /* 0x42 - F8 */ 96 0x42, /* 0x42 - F8 */ 97 // SPECIAL, /* 0x43 - F9 */ 98 0x43, /* 0x43 - F9 */ 99 // SPECIAL, /* 0x44 - F10 */ 100 0x44, /* 0x44 - F10 */ 92 101 SPECIAL, /* 0x45 - NumLock */ 93 102 SPECIAL, /* 0x46 - ScrollLock */ … … 160 169 ' ', 161 170 SPECIAL, /* 0x3a - CapsLock */ 162 SPECIAL, /* 0x3b - F1 */ 163 SPECIAL, /* 0x3c - F2 */ 164 SPECIAL, /* 0x3d - F3 */ 165 SPECIAL, /* 0x3e - F4 */ 166 SPECIAL, /* 0x3f - F5 */ 167 SPECIAL, /* 0x40 - F6 */ 168 SPECIAL, /* 0x41 - F7 */ 169 SPECIAL, /* 0x42 - F8 */ 170 SPECIAL, /* 0x43 - F9 */ 171 SPECIAL, /* 0x44 - F10 */ 171 0x3b, /* 0x3b - F1 */ 172 0x3c, /* 0x3c - F2 */ 173 0x3d, /* 0x3d - F3 */ 174 0x3e, /* 0x3e - F4 */ 175 0x3f, /* 0x3f - F5 */ 176 0x40, /* 0x40 - F6 */ 177 0x41, /* 0x41 - F7 */ 178 0x42, /* 0x42 - F8 */ 179 0x43, /* 0x43 - F9 */ 180 0x44, /* 0x44 - F10 */ 181 // SPECIAL, /* 0x3b - F1 */ 182 // SPECIAL, /* 0x3c - F2 */ 183 // SPECIAL, /* 0x3d - F3 */ 184 // SPECIAL, /* 0x3e - F4 */ 185 // SPECIAL, /* 0x3f - F5 */ 186 // SPECIAL, /* 0x40 - F6 */ 187 // SPECIAL, /* 0x41 - F7 */ 188 // SPECIAL, /* 0x42 - F8 */ 189 // SPECIAL, /* 0x43 - F9 */ 190 // SPECIAL, /* 0x44 - F10 */ 172 191 SPECIAL, /* 0x45 - NumLock */ 173 192 SPECIAL, /* 0x46 - ScrollLock */ … … 231 250 }; 232 251 233 static int key_released( unsigned char key)252 static int key_released(keybuffer_t *keybuffer, unsigned char key) 234 253 { 235 254 switch (key) { … … 250 269 } 251 270 252 static int key_pressed( unsigned char key)271 static int key_pressed(keybuffer_t *keybuffer, unsigned char key) 253 272 { 254 273 char *map = sc_primary_map; … … 268 287 break; 269 288 case SC_LEFTARR: 270 if (key _buffer_available() >= 3) {271 key _buffer_push(0x1b);272 key _buffer_push(0x5b);273 key _buffer_push(0x44);289 if (keybuffer_available(keybuffer) >= 3) { 290 keybuffer_push(keybuffer, 0x1b); 291 keybuffer_push(keybuffer, 0x5b); 292 keybuffer_push(keybuffer, 0x44); 274 293 } 275 294 break; 276 295 case SC_RIGHTARR: 277 if (key _buffer_available() >= 3) {278 key _buffer_push(0x1b);279 key _buffer_push(0x5b);280 key _buffer_push(0x43);296 if (keybuffer_available(keybuffer) >= 3) { 297 keybuffer_push(keybuffer, 0x1b); 298 keybuffer_push(keybuffer, 0x5b); 299 keybuffer_push(keybuffer, 0x43); 281 300 } 282 301 break; 283 302 case SC_UPARR: 284 if (key _buffer_available() >= 3) {285 key _buffer_push(0x1b);286 key _buffer_push(0x5b);287 key _buffer_push(0x41);303 if (keybuffer_available(keybuffer) >= 3) { 304 keybuffer_push(keybuffer, 0x1b); 305 keybuffer_push(keybuffer, 0x5b); 306 keybuffer_push(keybuffer, 0x41); 288 307 } 289 308 break; 290 309 case SC_DOWNARR: 291 if (key _buffer_available() >= 3) {292 key _buffer_push(0x1b);293 key _buffer_push(0x5b);294 key _buffer_push(0x42);310 if (keybuffer_available(keybuffer) >= 3) { 311 keybuffer_push(keybuffer, 0x1b); 312 keybuffer_push(keybuffer, 0x5b); 313 keybuffer_push(keybuffer, 0x42); 295 314 } 296 315 break; 297 316 case SC_HOME: 298 if (key _buffer_available() >= 3) {299 key _buffer_push(0x1b);300 key _buffer_push(0x4f);301 key _buffer_push(0x48);317 if (keybuffer_available(keybuffer) >= 3) { 318 keybuffer_push(keybuffer, 0x1b); 319 keybuffer_push(keybuffer, 0x4f); 320 keybuffer_push(keybuffer, 0x48); 302 321 } 303 322 break; 304 323 case SC_END: 305 if (key _buffer_available() >= 3) {306 key _buffer_push(0x1b);307 key _buffer_push(0x4f);308 key _buffer_push(0x46);324 if (keybuffer_available(keybuffer) >= 3) { 325 keybuffer_push(keybuffer, 0x1b); 326 keybuffer_push(keybuffer, 0x4f); 327 keybuffer_push(keybuffer, 0x46); 309 328 } 310 329 break; 311 330 case SC_DELETE: 312 if (key _buffer_available() >= 4) {313 key _buffer_push(0x1b);314 key _buffer_push(0x5b);315 key _buffer_push(0x33);316 key _buffer_push(0x7e);331 if (keybuffer_available(keybuffer) >= 4) { 332 keybuffer_push(keybuffer, 0x1b); 333 keybuffer_push(keybuffer, 0x5b); 334 keybuffer_push(keybuffer, 0x33); 335 keybuffer_push(keybuffer, 0x7e); 317 336 } 318 337 break; … … 325 344 if (shift) 326 345 map = sc_secondary_map; 327 key _buffer_push(map[key]);346 keybuffer_push(keybuffer, map[key]); 328 347 break; 329 348 } … … 338 357 } 339 358 340 int kbd_arch_process( int scan_code)359 int kbd_arch_process(keybuffer_t *keybuffer, int scan_code) 341 360 { 342 361 if (scan_code != IGNORE_CODE) { 343 362 if (scan_code & KEY_RELEASE) 344 key_released( scan_code ^ KEY_RELEASE);363 key_released(keybuffer, scan_code ^ KEY_RELEASE); 345 364 else 346 key_pressed( scan_code);365 key_pressed(keybuffer, scan_code); 347 366 } 348 367 return 1;
Note:
See TracChangeset
for help on using the changeset viewer.