aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2021-04-25 11:34:56 +0200
committerArisotura <thetotalworm@gmail.com>2021-04-25 11:34:56 +0200
commit185c97f4ef71c5fdf96bf8cde820850d5035ba9a (patch)
tree970feb8ee34b990d193e501aa5a82e0324e8f3f4
parent9d9865d256a8af244f60be69b6d7bd4753e7c181 (diff)
try to cover right-mod keys under MacOS I guess
-rw-r--r--src/frontend/qt_sdl/Input.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/frontend/qt_sdl/Input.cpp b/src/frontend/qt_sdl/Input.cpp
index ed014b7..f3ad651 100644
--- a/src/frontend/qt_sdl/Input.cpp
+++ b/src/frontend/qt_sdl/Input.cpp
@@ -226,7 +226,6 @@ bool HotkeyPressed(int id) { return HotkeyPress & (1<<id); }
bool HotkeyReleased(int id) { return HotkeyRelease & (1<<id); }
-// TODO: MacOS version of this!
// distinguish between left and right modifier keys (Ctrl, Alt, Shift)
// Qt provides no real cross-platform way to do this, so here we go
// for Windows and Linux we can distinguish via scancodes (but both
@@ -237,6 +236,12 @@ bool IsRightModKey(QKeyEvent* event)
quint32 scan = event->nativeScanCode();
return (scan == 0x11D || scan == 0x138 || scan == 0x36);
}
+#elifdef __APPLE__
+bool IsRightModKey(QKeyEvent* event)
+{
+ quint32 scan = event->nativeVirtualKey();
+ return (scan == 0x37 || scan == 0x3A || scan == 0x3C || scan == 0x3E);
+}
#else
bool IsRightModKey(QKeyEvent* event)
{