Changeset 36989 in vbox for trunk/src/VBox/Devices
- Timestamp:
- May 6, 2011 4:15:15 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/DevPS2.cpp
r35353 r36989 267 267 } KBDState; 268 268 269 /* Table to convert from PC scancodes to raw scancodes.*/270 static const unsigned char ps2_raw_keycode [128] = {269 /* Table to convert from PC scancodes to scan code set 2. */ 270 static const unsigned char ps2_raw_keycode_set2[128] = { 271 271 0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13, 272 272 21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 20, 28, 27, 273 273 35, 43, 52, 51, 59, 66, 75, 76, 82, 14, 18, 93, 26, 34, 33, 42, 274 274 50, 49, 58, 65, 73, 74, 89,124, 17, 41, 88, 5, 6, 4, 12, 3, 275 11, 2, 10, 1, 9,119,126,108,117,125,123,107,115,116,121,105, 276 114,122,112,113,127, 96, 97,120, 7, 15, 23, 31, 39, 47, 55, 63, 277 71, 79, 86, 94, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 87,111, 278 19, 25, 57, 81, 83, 92, 95, 98, 99,100,101,103,104,106,109,110 279 }; 280 281 /* Table to convert from PC scancodes to scan code set 3. */ 282 static const unsigned char ps2_raw_keycode_set3[128] = { 283 0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13, 284 21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 17, 28, 27, 285 35, 43, 52, 51, 59, 66, 75, 76, 82, 14, 18, 92, 26, 34, 33, 42, 286 50, 49, 58, 65, 73, 74, 89,124, 25, 41, 20, 5, 6, 4, 12, 3, 275 287 11, 2, 10, 1, 9,119,126,108,117,125,123,107,115,116,121,105, 276 288 114,122,112,113,127, 96, 97,120, 7, 15, 23, 31, 39, 47, 55, 63, … … 379 391 380 392 /* XXX: add support for scancode sets 1 and 3 */ 381 if (!s->translate && keycode < 0xe0 && s->scancode_set == 2)393 if (!s->translate && keycode < 0xe0 && s->scancode_set >= 2) 382 394 { 383 395 if (keycode & 0x80) 384 396 kbd_queue(s, 0xf0, 0); 385 keycode = ps2_raw_keycode[keycode & 0x7f]; 397 if (s->scancode_set == 2) 398 keycode = ps2_raw_keycode_set2[keycode & 0x7f]; 399 else if (s->scancode_set == 3) 400 keycode = ps2_raw_keycode_set3[keycode & 0x7f]; 386 401 } 387 402 kbd_queue(s, keycode, 0); … … 638 653 pc_kbd_put_keycode(s, 0x3f); 639 654 } else { 640 if (val >= 1 && val <= 3) 655 if (val >= 1 && val <= 3) { 656 LogRel(("kbd: scan code set %d selected\n", val)); 641 657 s->scancode_set = val; 658 } 642 659 kbd_queue(s, KBD_REPLY_ACK, 0); 643 660 }
Note:
See TracChangeset
for help on using the changeset viewer.