summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-11-17 19:32:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2013-11-17 19:32:07 +0100
commit8a3e9c35142c115188b03aa4d73117a8f12e3175 (patch)
tree16ed70bea9e5e5b43b54f3b7e6619f72a43be01e
parent8373c6cd439e4cf393d03f603e8e914cc7dfabf6 (diff)
Try to implement darwin modifier keys
-rw-r--r--qxt-mini/qxtglobalshortcut_p.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/qxt-mini/qxtglobalshortcut_p.h b/qxt-mini/qxtglobalshortcut_p.h
index e3f3ddd3..5b10d089 100644
--- a/qxt-mini/qxtglobalshortcut_p.h
+++ b/qxt-mini/qxtglobalshortcut_p.h
@@ -75,11 +75,19 @@ public:
EventRef Event = reinterpret_cast<EventRef>(message);
UInt32 EventClass = GetEventClass (Event);
UInt32 EventKind = GetEventKind (Event);
+ UInt32 eventModifiers = 0;
+ GetEventParameter(Event,
+ kEventParamKeyModifiers,
+ typeUInt32,
+ NULL,
+ sizeof(UInt32),
+ NULL,
+ &eventModifiers);
if (kEventClassKeyboard && EventKind == kEventRawKeyDown)
{
- UInt32 keyPressed;
+ UInt32 keyPressed = -1;
GetEventParameter(Event, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyPressed);
- return keyPressed == nativeKeycode(key);
+ return keyPressed == nativeKeycode(key) && nativeModifiers(mods) == eventModifiers;
}
}
#endif // Q_WS_MAC