Author: aandrejevic Date: Sun Oct 27 14:57:12 2013 New Revision: 60771
URL: http://svn.reactos.org/svn/reactos?rev=60771&view=rev Log: [NTVDM] Implement the BIOS keyboard shift flags.
Modified: branches/ntvdm/subsystems/ntvdm/bios.c branches/ntvdm/subsystems/ntvdm/bios.h
Modified: branches/ntvdm/subsystems/ntvdm/bios.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?re... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Sun Oct 27 14:57:12 2013 @@ -1150,7 +1150,8 @@ /* Key press */ if (VirtualKey == VK_NUMLOCK || VirtualKey == VK_CAPITAL - || VirtualKey == VK_SCROLL) + || VirtualKey == VK_SCROLL + || VirtualKey == VK_INSERT) { /* For toggle keys, toggle the lowest bit in the keyboard map */ BiosKeyboardMap[VirtualKey] ^= ~(1 << 0); @@ -1178,6 +1179,27 @@ } }
+ /* Clear the keyboard flags */ + Bda->KeybdShiftFlags = 0; + + /* Set the appropriate flags based on the state */ + if (BiosKeyboardMap[VK_RSHIFT] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_RSHIFT; + if (BiosKeyboardMap[VK_LSHIFT] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_LSHIFT; + if (BiosKeyboardMap[VK_CONTROL] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_CTRL; + if (BiosKeyboardMap[VK_MENU] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_ALT; + if (BiosKeyboardMap[VK_SCROLL] & (1 << 0)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_SCROLL_ON; + if (BiosKeyboardMap[VK_NUMLOCK] & (1 << 0)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_NUMLOCK_ON; + if (BiosKeyboardMap[VK_CAPITAL] & (1 << 0)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_CAPSLOCK_ON; + if (BiosKeyboardMap[VK_INSERT] & (1 << 0)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_INSERT_ON; + if (BiosKeyboardMap[VK_RMENU] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_RALT; + if (BiosKeyboardMap[VK_LMENU] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_LALT; + if (BiosKeyboardMap[VK_SNAPSHOT] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_SYSRQ; + if (BiosKeyboardMap[VK_PAUSE] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_PAUSE; + if (BiosKeyboardMap[VK_SCROLL] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_SCROLL; + if (BiosKeyboardMap[VK_NUMLOCK] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_NUMLOCK; + if (BiosKeyboardMap[VK_CAPITAL] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_CAPSLOCK; + if (BiosKeyboardMap[VK_INSERT] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_INSERT; + break; } }
Modified: branches/ntvdm/subsystems/ntvdm/bios.h URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.h?re... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.h [iso-8859-1] Sun Oct 27 14:57:12 2013 @@ -38,6 +38,23 @@ #define DEFAULT_ATTRIBUTE 0x07 #define GRAPHICS_VIDEO_SEG 0xA000 #define TEXT_VIDEO_SEG 0xB800 + +#define BDA_KBDFLAG_RSHIFT (1 << 0) +#define BDA_KBDFLAG_LSHIFT (1 << 1) +#define BDA_KBDFLAG_CTRL (1 << 2) +#define BDA_KBDFLAG_ALT (1 << 3) +#define BDA_KBDFLAG_SCROLL_ON (1 << 4) +#define BDA_KBDFLAG_NUMLOCK_ON (1 << 5) +#define BDA_KBDFLAG_CAPSLOCK_ON (1 << 6) +#define BDA_KBDFLAG_INSERT_ON (1 << 7) +#define BDA_KBDFLAG_RALT (1 << 8) +#define BDA_KBDFLAG_LALT (1 << 9) +#define BDA_KBDFLAG_SYSRQ (1 << 10) +#define BDA_KBDFLAG_PAUSE (1 << 11) +#define BDA_KBDFLAG_SCROLL (1 << 12) +#define BDA_KBDFLAG_NUMLOCK (1 << 13) +#define BDA_KBDFLAG_CAPSLOCK (1 << 14) +#define BDA_KBDFLAG_INSERT (1 << 15)
enum {