Keyboard: Refactor for GetKeyState()

This commit is contained in:
tomcw
2018-07-23 22:27:33 +01:00
parent 5e13bef808
commit 1afa2490c5
4 changed files with 11 additions and 11 deletions
+6 -5
View File
@@ -102,9 +102,9 @@ bool KeybGetShiftStatus ()
//===========================================================================
void KeybUpdateCtrlShiftStatus()
{
g_bShiftKey = (GetKeyState( VK_SHIFT ) & KF_UP) ? true : false;
g_bCtrlKey = (GetKeyState( VK_CONTROL) & KF_UP) ? true : false;
g_bAltKey = (GetKeyState( VK_MENU ) & KF_UP) ? true : false;
g_bShiftKey = (GetKeyState( VK_SHIFT ) < 0) ? true : false; // L or R shift
g_bCtrlKey = (GetKeyState( VK_CONTROL) < 0) ? true : false; // L or R ctrl
g_bAltKey = (GetKeyState( VK_MENU ) < 0) ? true : false; // L or R alt
}
//===========================================================================
@@ -114,7 +114,7 @@ BYTE KeybGetKeycode () // Used by IORead_C01x() and TapeRead() for Pravets8A
}
//===========================================================================
void KeybQueueKeypress (int key, BOOL bASCII)
void KeybQueueKeypress(WPARAM key, Keystroke_e bASCII)
{
if (bASCII == ASCII) // WM_CHAR
{
@@ -307,9 +307,10 @@ void KeybQueueKeypress (int key, BOOL bASCII)
return;
keycode = n;
}
else if ((GetKeyState( VK_RMENU ) & KF_UP)) // Right ALT
else if ((GetKeyState(VK_RMENU) < 0)) // Right Alt (aka Alt Gr)
{
//
return;
}
else
{