summaryrefslogtreecommitdiff
path: root/delegateuitask_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-06 22:22:36 -0400
committerPietro Gagliardi <[email protected]>2014-06-06 22:22:36 -0400
commit42e2c130acffc2df9e1d9fe19a2b8b10281c3928 (patch)
tree98b9853f56d99c942333582bd88aa48a0441f945 /delegateuitask_darwin.m
parentb6ca65069244ef4d85ae7f26e6bfee046cb4b6a8 (diff)
Did half the work to fix Help key handling in Mac OS X.
Diffstat (limited to 'delegateuitask_darwin.m')
-rw-r--r--delegateuitask_darwin.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/delegateuitask_darwin.m b/delegateuitask_darwin.m
index 023cb49..09dcbfd 100644
--- a/delegateuitask_darwin.m
+++ b/delegateuitask_darwin.m
@@ -35,6 +35,7 @@
#import <Foundation/NSAutoreleasePool.h>
#import <AppKit/NSEvent.h>
#import <AppKit/NSAlert.h>
+#import <AppKit/NSHelpManager.h>
extern NSRect dummyRect;
@@ -74,6 +75,13 @@ extern NSRect dummyRect;
{
}
+// see below
+// TODO is this the correct signature?
+- (void)helpbreaker:(NSNotification *)n
+{
+ [NSHelpManager setContextHelpModeActive:NO];
+}
+
@end
id makeAppDelegate(void)
@@ -94,6 +102,14 @@ BOOL initCocoa(id appDelegate)
return NO;
[NSApp activateIgnoringOtherApps:YES]; // TODO actually do C.NO here? Russ Cox does YES in his devdraw; the docs say the Finder does NO
[NSApp setDelegate:appDelegate];
+ // by default, Mac OS X intercepts Help key keyDown events
+ // we treat Help as Insert, so we don't want this behavior
+ // this will override it; see http://stackoverflow.com/a/4078542/3408572
+ // TODO this doesn't send keyDown:
+ [[NSNotificationCenter defaultCenter] addObserver:appDelegate
+ selector:@selector(helpbreaker:)
+ name:NSContextHelpModeDidActivateNotification
+ object:nil];
return YES;
}