mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 16:41:55 +00:00
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:
parent
8a49acfb4c
commit
ebbab146de
3 changed files with 32 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
2006-10-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSWindow.m: Add help key support for context help.
|
||||
|
||||
2006-10-02 20:41-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Resources/Esperanto.lproj/Localizable.strings
|
||||
|
|
|
@ -287,6 +287,7 @@ static NSCursor *helpCursor = nil;
|
|||
|
||||
+ (void) setContextHelpModeActive: (BOOL) flag
|
||||
{
|
||||
NSLog(@"setContextHelpModeActive: %d", flag);
|
||||
if (flag != _gnu_contextHelpActive)
|
||||
{
|
||||
_gnu_contextHelpActive = flag;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue