summaryrefslogtreecommitdiff
path: root/redo/area_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-11 11:52:10 -0400
committerPietro Gagliardi <[email protected]>2014-08-11 11:52:10 -0400
commitbb8603ed4e169cc4a9666e462cc5cd4f341ad100 (patch)
treead7310294dbb5997aa7463e87ab3931881515de7 /redo/area_darwin.m
parent5a67a81e0bf7e91635546597dfb1a15d28dca593 (diff)
Moved Mac OS X modifier flags constants to the Objective-C side for maximum safety.
Diffstat (limited to 'redo/area_darwin.m')
-rw-r--r--redo/area_darwin.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/redo/area_darwin.m b/redo/area_darwin.m
index 1f7ece6..f99737f 100644
--- a/redo/area_darwin.m
+++ b/redo/area_darwin.m
@@ -140,6 +140,12 @@ BOOL drawImage(void *pixels, intptr_t width, intptr_t height, intptr_t stride, i
return success;
}
+// can't include the header file with these from the Go side since it's an Objective-C header file; keep them here to be safe
+const uintptr_t cNSShiftKeyMask = (uintptr_t) NSShiftKeyMask;
+const uintptr_t cNSControlKeyMask = (uintptr_t) NSControlKeyMask;
+const uintptr_t cNSAlternateKeyMask = (uintptr_t) NSAlternateKeyMask;
+const uintptr_t cNSCommandKeyMask = (uintptr_t) NSCommandKeyMask;
+
uintptr_t modifierFlags(id e)
{
return fromNSUInteger([toNSEvent(e) modifierFlags]);