Fix #109525: Improved Win32 Repeat Key Filtering #109991

Merged
Harley Acheson merged 1 commits from Harley/blender:WinModifiers into main 2023-07-12 20:55:06 +02:00
2 changed files with 2 additions and 10 deletions

View File

@ -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

View File

@ -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. */