summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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