From fab29d0a0a85a06647ab3ad704ee2c6cb7db0edb Mon Sep 17 00:00:00 2001 From: RadAd Date: Fri, 24 May 2019 13:42:36 +1000 Subject: Better handling of ctrl,alt,etc. --- .gitignore | 1 + RadTerminal.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index a15991d..b2c6157 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ Bin/ Int/ .vs/ *.VC.db +*.VC.VC.opendb *.vcxproj.user diff --git a/RadTerminal.cpp b/RadTerminal.cpp index ff0d61b..87696d5 100644 --- a/RadTerminal.cpp +++ b/RadTerminal.cpp @@ -412,15 +412,15 @@ void RadTerminalWindowOnKeyDown(HWND hWnd, UINT vk, BOOL fDown, int cRepeat, UIN uint32_t unicode = ascii; unsigned int mods = 0; - if (KeyState[VK_SHIFT] != 0) + if (KeyState[VK_SHIFT] & 0x8) mods |= TSM_SHIFT_MASK; - if (KeyState[VK_SCROLL] != 0) + if (KeyState[VK_SCROLL] & 0x8) mods |= TSM_LOCK_MASK; - if (KeyState[VK_CONTROL] != 0) + if (KeyState[VK_CONTROL] & 0x8) mods |= TSM_CONTROL_MASK; - if (KeyState[VK_MENU] != 0) + if (KeyState[VK_MENU] & 0x8) mods |= TSM_ALT_MASK; - if (KeyState[VK_LWIN] != 0) + if (KeyState[VK_LWIN] & 0x8) mods |= TSM_LOGO_MASK; UINT scan = (cRepeat >> 8); -- cgit v1.2.3