diff options
author | David Robillard <d@drobilla.net> | 2012-04-30 19:27:03 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-30 19:27:03 +0000 |
commit | 5982d745c315f2b73d43f82ca018d183198c15af (patch) | |
tree | 61e7a8f1e7dfb5fa2796ee7286641742fc06f96f /pugl/pugl_win.cpp | |
parent | fcd41b09001c2438595a94132c7ae6664c4d1bc3 (diff) | |
download | pugl-5982d745c315f2b73d43f82ca018d183198c15af.tar.gz pugl-5982d745c315f2b73d43f82ca018d183198c15af.tar.bz2 pugl-5982d745c315f2b73d43f82ca018d183198c15af.zip |
Implement modifiers for Windows.
Diffstat (limited to 'pugl/pugl_win.cpp')
-rw-r--r-- | pugl/pugl_win.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp index 2cb135c..a9641ad 100644 --- a/pugl/pugl_win.cpp +++ b/pugl/pugl_win.cpp @@ -196,6 +196,17 @@ processMouseEvent(PuglView* view, int button, bool press, LPARAM lParam) } } +static void +setModifiers(PuglView* view) +{ + view->mods = 0; + view->mods |= GetKeyState(VK_SHIFT) ? PUGL_MOD_SHIFT : 0; + view->mods |= GetKeyState(VK_CONTROL) ? PUGL_MOD_CTRL : 0; + view->mods |= GetKeyState(VK_MENU) ? PUGL_MOD_ALT : 0; + view->mods |= GetKeyState(VK_LWIN) ? PUGL_MOD_SUPER : 0; + view->mods |= GetKeyState(VK_RWIN) ? PUGL_MOD_SUPER : 0; +} + PuglStatus puglProcessEvents(PuglView* view) { @@ -205,6 +216,7 @@ puglProcessEvents(PuglView* view) bool down = true; PuglKey key; while (PeekMessage(&msg, /*view->impl->hwnd*/0, 0, 0, PM_REMOVE)) { + setModifiers(view); switch (msg.message) { case WM_CREATE: case WM_SHOWWINDOW: |