aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pugl/pugl_win.cpp10
-rw-r--r--pugl/pugl_x11.c5
2 files changed, 8 insertions, 7 deletions
diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp
index a6b604f..6c4b07f 100644
--- a/pugl/pugl_win.cpp
+++ b/pugl/pugl_win.cpp
@@ -200,11 +200,11 @@ 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;
+ view->mods |= (GetKeyState(VK_SHIFT) < 0) ? PUGL_MOD_SHIFT : 0;
+ view->mods |= (GetKeyState(VK_CONTROL) < 0) ? PUGL_MOD_CTRL : 0;
+ view->mods |= (GetKeyState(VK_MENU) < 0) ? PUGL_MOD_ALT : 0;
+ view->mods |= (GetKeyState(VK_LWIN) < 0) ? PUGL_MOD_SUPER : 0;
+ view->mods |= (GetKeyState(VK_RWIN) < 0) ? PUGL_MOD_SUPER : 0;
}
PuglStatus
diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c
index c180a9a..08bfc40 100644
--- a/pugl/pugl_x11.c
+++ b/pugl/pugl_x11.c
@@ -75,8 +75,9 @@ puglCreate(PuglNativeWindow parent,
PuglPlatformData* impl = view->impl;
- view->width = width;
- view->height = height;
+ view->width = width;
+ view->height = height;
+
impl->display = XOpenDisplay(0);
impl->screen = DefaultScreen(impl->display);