VirtualBox

Ignore:
Timestamp:
Feb 23, 2012 4:08:49 PM (13 years ago)
Author:
vboxsync
Message:

BIOS: Do not let fake shift keys modify shift flags.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS/rombios.c

    r39946 r40236  
    52355235{
    52365236  Bit8u scancode, asciicode, shift_flags;
    5237   Bit8u mf2_flags, mf2_state;
     5237  Bit8u mf2_flags, mf2_state, flag;
    52385238
    52395239  //
     
    52685268
    52695269    case 0x2a: /* L Shift press */
    5270       shift_flags |= 0x02;
    5271       write_byte(0x0040, 0x17, shift_flags);
    5272       break;
    52735270    case 0xaa: /* L Shift release */
    5274       shift_flags &= ~0x02;
    5275       write_byte(0x0040, 0x17, shift_flags);
    5276       break;
    5277 
    52785271    case 0x36: /* R Shift press */
    5279       shift_flags |= 0x01;
    5280       write_byte(0x0040, 0x17, shift_flags);
    5281       break;
    52825272    case 0xb6: /* R Shift release */
    5283       shift_flags &= ~0x01;
    5284       write_byte(0x0040, 0x17, shift_flags);
     5273      /* If this was an extended (i.e. faked) key, leave flags alone. */
     5274      if (!(mf2_state & 0x02)) {
     5275        flag = (scancode & 0x7f) == 0x2a ? 0x02 : 0x01;
     5276        if (scancode & 0x80)
     5277          shift_flags &= ~flag;
     5278        else
     5279          shift_flags |= flag;
     5280        write_byte(0x0040, 0x17, shift_flags);
     5281      }
    52855282      break;
    52865283
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette