From 1759164f28846a6b7cffb2d46d8603ba4ef95a58 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Wed, 12 Jul 2023 11:39:08 -0700 Subject: [PATCH] Splitting multi-window modifier status change out to #110020 --- intern/ghost/intern/GHOST_SystemWin32.cc | 10 ++-------- intern/ghost/intern/GHOST_SystemWin32.hh | 2 -- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemWin32.cc b/intern/ghost/intern/GHOST_SystemWin32.cc index c6ac31f7c59..21b9f33a25d 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cc +++ b/intern/ghost/intern/GHOST_SystemWin32.cc @@ -1210,16 +1210,11 @@ GHOST_EventKey *GHOST_SystemWin32::processKeyEvent(GHOST_WindowWin32 *window, RA bool is_repeat = false; bool is_repeated_modifier = false; if (key_down) { - if (system->m_keycode_last_repeat_key == vk) { + if (HIBYTE(::GetKeyState(vk)) != 0) { + /* This thread's message queue shows this key as already down. */ is_repeat = true; is_repeated_modifier = GHOST_KEY_MODIFIER_CHECK(key); } - system->m_keycode_last_repeat_key = vk; - } - else { - if (system->m_keycode_last_repeat_key == vk) { - system->m_keycode_last_repeat_key = 0; - } } /* We used to check `if (key != GHOST_kKeyUnknown)`, but since the message @@ -1995,7 +1990,6 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, uint msg, WPARAM wParam, * so the window is activated immediately. */ system->m_wheelDeltaAccum = 0; - system->m_keycode_last_repeat_key = 0; event = processWindowEvent( LOWORD(wParam) ? GHOST_kEventWindowActivate : GHOST_kEventWindowDeactivate, window); /* WARNING: Let DefWindowProc handle WM_ACTIVATE, otherwise WM_MOUSEWHEEL diff --git a/intern/ghost/intern/GHOST_SystemWin32.hh b/intern/ghost/intern/GHOST_SystemWin32.hh index 72209c67a4e..5437e3667b7 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.hh +++ b/intern/ghost/intern/GHOST_SystemWin32.hh @@ -455,8 +455,6 @@ class GHOST_SystemWin32 : public GHOST_System { */ bool setConsoleWindowState(GHOST_TConsoleWindowState action); - /** The virtual-key code (VKey) of the last press event. Used to detect repeat events. */ - unsigned short m_keycode_last_repeat_key; /** State variable set at initialization. */ bool m_hasPerformanceCounter; /** High frequency timer variable. */ -- 2.30.2