]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/windows/keyboard.cpp
Update .gitignore to include build products on Windows
[libs/gui.git] / source / input / windows / keyboard.cpp
index e6882fe917dd3183089460107fe8c24e162e0bf0..47f2256a20b3eb9f534b84f1b212f3616bad3ba4 100644 (file)
@@ -1,10 +1,12 @@
+#include "keyboard.h"
 #include <windows.h>
 #include <msp/graphics/window_private.h>
-#include "keyboard.h"
 #include "keys.h"
 #include "keys_private.h"
 
+#ifndef MAPVK_VK_TO_VSC
 #define MAPVK_VK_TO_VSC 0
+#endif
 
 namespace Msp {
 namespace Input {
@@ -31,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)
@@ -40,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, 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: