diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 404b570a..b38f40d8 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -780,7 +780,7 @@ Update_t CmdBenchmarkStop (int nArgs) DWORD currtime = GetTickCount(); while ((extbench = GetTickCount()) != currtime) ; // intentional busy-waiting - KeybQueueKeypress(TEXT(' '),1); + KeybQueueKeypress(TEXT(' ') ,ASCII); return UPDATE_ALL; // 0; } @@ -2096,7 +2096,7 @@ Update_t CmdUnassemble (int nArgs) Update_t CmdKey (int nArgs) { KeybQueueKeypress( - nArgs ? g_aArgs[1].nValue ? g_aArgs[1].nValue : g_aArgs[1].sArg[0] : TEXT(' '), 1); // FIXME!!! + nArgs ? g_aArgs[1].nValue ? g_aArgs[1].nValue : g_aArgs[1].sArg[0] : TEXT(' '), ASCII); // FIXME!!! return UPDATE_CONSOLE_DISPLAY; } diff --git a/source/Frame.h b/source/Frame.h index 672b95e9..f5cace2d 100644 --- a/source/Frame.h +++ b/source/Frame.h @@ -3,9 +3,6 @@ // 1.19.0.0 Hard Disk Status/Indicator Light #define HD_LED 1 - // Keyboard -- keystroke type - enum {NOT_ASCII=0, ASCII}; - // Win32 extern HWND g_hFrameWindow; diff --git a/source/Keyboard.cpp b/source/Keyboard.cpp index bd1bb24a..c890c4e2 100644 --- a/source/Keyboard.cpp +++ b/source/Keyboard.cpp @@ -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 { diff --git a/source/Keyboard.h b/source/Keyboard.h index c5518620..802903fc 100644 --- a/source/Keyboard.h +++ b/source/Keyboard.h @@ -1,5 +1,7 @@ #pragma once +enum Keystroke_e {NOT_ASCII=0, ASCII}; + void ClipboardInitiatePaste(); void KeybReset(); @@ -11,7 +13,7 @@ bool KeybGetShiftStatus(); bool KeybGetCapsAllowed(); //For Pravets8A/C only void KeybUpdateCtrlShiftStatus(); BYTE KeybGetKeycode (); -void KeybQueueKeypress (int,BOOL); +void KeybQueueKeypress(WPARAM key, Keystroke_e bASCII); void KeybToggleCapsLock (); void KeybToggleP8ACapsLock (); void KeybAnyKeyDown(UINT message, WPARAM wparam, bool bIsExtended);