From: Mikko Rasa Date: Fri, 20 Sep 2019 22:26:38 +0000 (+0300) Subject: Generate synthetic key release events for repeated keys on Windows X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ce170ea187abe2b8017cde611d0e2e86a523ee79;p=libs%2Fgui.git Generate synthetic key release events for repeated keys on Windows The OS only sends WM_KEYDOWN messages as long as the key is pressed. --- diff --git a/source/input/windows/keyboard.cpp b/source/input/windows/keyboard.cpp index d9810b1..690ba3a 100644 --- a/source/input/windows/keyboard.cpp +++ b/source/input/windows/keyboard.cpp @@ -44,7 +44,9 @@ void Keyboard::input_event(const Graphics::Window::Event &event) else key = VK_LSHIFT; } - set_button_state(key_from_sys(key), (event.msg==WM_KEYDOWN || event.msg==WM_SYSKEYDOWN), true); + set_button_state(key_from_sys(key), false, true); + if(event.msg==WM_KEYDOWN || event.msg==WM_SYSKEYDOWN) + set_button_state(key_from_sys(key), true, true); } break; case WM_CHAR: