Did half the work to fix Help key handling in Mac OS X.

This commit is contained in:
Pietro Gagliardi 2014-06-06 22:22:36 -04:00
parent b6ca650692
commit 42e2c130ac
2 changed files with 16 additions and 1 deletions

View File

@ -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;
}

View File

@ -3,7 +3,6 @@ MAC OS X:
- asked: http://stackoverflow.com/questions/23046414/cocoa-how-do-i-get-nscombobox-indexofselecteditem-to-return-1-if-the-user-m
- 10.6 also spits a bunch of NSNoAutoreleasePool() debug log messages even though I thoguht I had everything in an NSAutoreleasePool...
- OS X: key up with a modifier held and our new modifiers code doesn't seem to happen?
- figure out how to bypass the window manager's Help key handling
- point out that Areas get keyboard focus automatically on click on Mac OS X
- make sure Areas get keyboard focus when clicking outside the actual Area space on Mac OS X