Add help key support

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23749 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-10-04 05:26:47 +00:00
parent 8a49acfb4c
commit ebbab146de
3 changed files with 32 additions and 0 deletions

View file

@ -2807,6 +2807,12 @@ resetCursorRectsForView(NSView *theView)
character = [characters characterAtIndex: 0];
}
if (character == NSHelpFunctionKey)
{
[NSHelpManager setContextHelpModeActive: YES];
return;
}
// If this is a TAB or TAB+SHIFT event, move to the next key view
if (character == NSTabCharacter)
{
@ -2866,6 +2872,27 @@ resetCursorRectsForView(NSView *theView)
[super keyDown: theEvent];
}
- (void) keyUp: (NSEvent*)theEvent
{
if ([NSHelpManager isContextHelpModeActive])
{
NSString *characters = [theEvent characters];
unichar character = 0;
if ([characters length] > 0)
{
character = [characters characterAtIndex: 0];
}
if (character == NSHelpFunctionKey)
{
[NSHelpManager setContextHelpModeActive: NO];
return;
}
}
[super keyUp: theEvent];
}
/* Return mouse location in reciever's base coord system, ignores event
* loop status */
- (NSPoint) mouseLocationOutsideOfEventStream