aboutsummaryrefslogtreecommitdiffstats
path: root/Framework/MASKeyMasks.h
diff options
context:
space:
mode:
authorTomáš Znamenáček2016-10-28 14:40:32 +0200
committerTomáš Znamenáček2016-10-28 14:40:32 +0200
commitf12ed861b095d0734173948594202e25ee7e926d (patch)
tree70529b576a710a13fe84fd591328c9de6b9bbc80 /Framework/MASKeyMasks.h
parentbf4329178d3982f25be96ff3156477349e6bc25d (diff)
downloadMASShortcut-f12ed861b095d0734173948594202e25ee7e926d.tar.bz2
Use modern key mask constants instead of the ones deprecated in 10.12
See #99 for details.
Diffstat (limited to 'Framework/MASKeyMasks.h')
-rw-r--r--Framework/MASKeyMasks.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/Framework/MASKeyMasks.h b/Framework/MASKeyMasks.h
new file mode 100644
index 0000000..1c3a0b9
--- /dev/null
+++ b/Framework/MASKeyMasks.h
@@ -0,0 +1,16 @@
+// https://github.com/shpakovski/MASShortcut/issues/99
+//
+// Long story short: NSControlKeyMask and friends were replaced with NSEventModifierFlagControl
+// and similar in macOS Sierra. The project builds fine & clean, but including MASShortcut in
+// a project with deployment target set to 10.12 results in several deprecation warnings because
+// of the control masks. Simply replacing the old symbols with the new ones isn’t an option,
+// since it breaks the build on older SDKs – in Travis, for example.
+//
+// It should be safe to remove this whole thing once the 10.12 SDK is ubiquitous.
+//
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
+#define NSEventModifierFlagCommand NSCommandKeyMask
+#define NSEventModifierFlagControl NSControlKeyMask
+#define NSEventModifierFlagOption NSAlternateKeyMask
+#define NSEventModifierFlagShift NSShiftKeyMask
+#endif