From: Mikko Rasa Date: Wed, 18 Sep 2019 15:04:33 +0000 (+0300) Subject: Handle WM_SYSKEYDOWN, WM_SYSKEYUP and WM_SYSCHAR events X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=f575d5573d562e53492e5ddb9021142c7ab0e1a6;p=libs%2Fgui.git Handle WM_SYSKEYDOWN, WM_SYSKEYUP and WM_SYSCHAR events Windows sends F10 and alt presses using these instead of the usual messages. --- diff --git a/source/graphics/windows/window.cpp b/source/graphics/windows/window.cpp index 977efcd..38e7f73 100644 --- a/source/graphics/windows/window.cpp +++ b/source/graphics/windows/window.cpp @@ -174,6 +174,9 @@ bool Window::event(const Event &evnt) case WM_KEYDOWN: case WM_KEYUP: case WM_CHAR: + case WM_SYSKEYDOWN: + case WM_SYSKEYUP: + case WM_SYSCHAR: case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MBUTTONDOWN: diff --git a/source/input/windows/keyboard.cpp b/source/input/windows/keyboard.cpp index a598ac8..d9810b1 100644 --- a/source/input/windows/keyboard.cpp +++ b/source/input/windows/keyboard.cpp @@ -33,6 +33,8 @@ void Keyboard::input_event(const Graphics::Window::Event &event) { case WM_KEYDOWN: case WM_KEYUP: + case WM_SYSKEYDOWN: + case WM_SYSKEYUP: { unsigned key = event.wparam | ((event.lparam>>16)&0x100); if(key==VK_SHIFT) @@ -42,7 +44,7 @@ void Keyboard::input_event(const Graphics::Window::Event &event) else key = VK_LSHIFT; } - set_button_state(key_from_sys(key), event.msg==WM_KEYDOWN, true); + set_button_state(key_from_sys(key), (event.msg==WM_KEYDOWN || event.msg==WM_SYSKEYDOWN), true); } break; case WM_CHAR: