]> git.tdb.fi Git - libs/gui.git/commitdiff
Handle WM_SYSKEYDOWN, WM_SYSKEYUP and WM_SYSCHAR events
authorMikko Rasa <tdb@tdb.fi>
Wed, 18 Sep 2019 15:04:33 +0000 (18:04 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 18 Sep 2019 15:04:33 +0000 (18:04 +0300)
Windows sends F10 and alt presses using these instead of the usual
messages.

source/graphics/windows/window.cpp
source/input/windows/keyboard.cpp

index 977efcdd5ea33fe147db8c82cf59fbb7208e6eec..38e7f730cd5bc6341aaeb00c30ae92fefa4d0374 100644 (file)
@@ -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:
index a598ac8450dcaf4735134d12a80876c43eb35fbe..d9810b18a8416b837054c38fe5617110f8fa6a01 100644 (file)
@@ -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: