diff --git a/src/core/mac_startup.mm b/src/core/mac_startup.mm index 2a8016d3c..003a34a7f 100644 --- a/src/core/mac_startup.mm +++ b/src/core/mac_startup.mm @@ -392,16 +392,16 @@ QKeySequence KeySequenceFromNSEvent(NSEvent* event) { } } - if (modifiers & NSShiftKeyMask) { + if (modifiers & NSEventModifierFlagShift) { key += Qt::SHIFT; } - if (modifiers & NSControlKeyMask) { + if (modifiers & NSEventModifierFlagControl) { key += Qt::META; } - if (modifiers & NSAlternateKeyMask) { + if (modifiers & NSEventModifierFlagOption) { key += Qt::ALT; } - if (modifiers & NSCommandKeyMask) { + if (modifiers & NSEventModifierFlagCommand) { key += Qt::CTRL; } diff --git a/src/globalshortcuts/globalshortcutbackend-macos.mm b/src/globalshortcuts/globalshortcutbackend-macos.mm index 8ea66a1d2..dff20c44d 100644 --- a/src/globalshortcuts/globalshortcutbackend-macos.mm +++ b/src/globalshortcuts/globalshortcutbackend-macos.mm @@ -51,10 +51,10 @@ class GlobalShortcutBackendMacOSPrivate : boost::noncopyable { : global_monitor_(nil), local_monitor_(nil), backend_(backend) {} bool Register() { - global_monitor_ = [NSEvent addGlobalMonitorForEventsMatchingMask:NSKeyDownMask handler:^(NSEvent* event) { + global_monitor_ = [NSEvent addGlobalMonitorForEventsMatchingMask:NSEventMaskKeyDown handler:^(NSEvent* event) { HandleKeyEvent(event); } ]; - local_monitor_ = [NSEvent addLocalMonitorForEventsMatchingMask:NSKeyDownMask handler:^(NSEvent* event) { + local_monitor_ = [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyDown handler:^(NSEvent* event) { // Filter event if we handle it as a global shortcut. return HandleKeyEvent(event) ? nil : event; } ]; diff --git a/src/globalshortcuts/globalshortcutgrabber.mm b/src/globalshortcuts/globalshortcutgrabber.mm index 0c2635ee1..53ca55d02 100644 --- a/src/globalshortcuts/globalshortcutgrabber.mm +++ b/src/globalshortcuts/globalshortcutgrabber.mm @@ -53,7 +53,7 @@ bool GlobalShortcutGrabber::HandleMacEvent(NSEvent* event) { } void GlobalShortcutGrabber::SetupMacEventHandler() { - id monitor = [NSEvent addLocalMonitorForEventsMatchingMask: NSKeyDownMask handler:^(NSEvent* event) { + id monitor = [NSEvent addLocalMonitorForEventsMatchingMask: NSEventMaskKeyDown handler:^(NSEvent* event) { return HandleMacEvent(event) ? event : nil; }]; wrapper_ = new MacMonitorWrapper(monitor);