From 5eacf0ed8eb410bca17ca743ec7ad1631be9bff8 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 8 Oct 2019 23:05:37 +0200 Subject: [PATCH] Implement GetAsyncKeyState (enables two debug features) - When started with -^ you can scroll the screen by holding shift and moving the mouse. - Holding menu will disable transparency. --- SourceX/miniwin/misc_msg.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/SourceX/miniwin/misc_msg.cpp b/SourceX/miniwin/misc_msg.cpp index 1826d5387..ad46fad0b 100644 --- a/SourceX/miniwin/misc_msg.cpp +++ b/SourceX/miniwin/misc_msg.cpp @@ -365,8 +365,16 @@ WINBOOL TranslateMessage(const MSG *lpMsg) SHORT GetAsyncKeyState(int vKey) { - DUMMY_ONCE(); - // TODO: Not handled yet. + const Uint8 *state = SDL_GetKeyboardState(NULL); + if (vKey == DVL_VK_SHIFT) { + if (state[SDL_SCANCODE_LSHIFT] || state[SDL_SCANCODE_RSHIFT]) { + return 0x8000; + } + } + if (vKey == DVL_VK_MENU && state[SDL_SCANCODE_M]) { + return 0x8000; + } + return 0; }