mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 19:17:40 +00:00
Add support for backtab character.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31026 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6d682ee88e
commit
ad9ddfe0ea
5 changed files with 33 additions and 3 deletions
|
@ -2517,6 +2517,9 @@ static NSTextFieldCell *titleCell;
|
|||
case NSRightArrowFunctionKey:
|
||||
[self moveRight:self];
|
||||
return;
|
||||
case NSBackTabCharacter:
|
||||
[_window selectKeyViewPrecedingView: self];
|
||||
return;
|
||||
case NSTabCharacter:
|
||||
{
|
||||
if ([theEvent modifierFlags] & NSShiftKeyMask)
|
||||
|
@ -2529,7 +2532,6 @@ static NSTextFieldCell *titleCell;
|
|||
}
|
||||
}
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
/* A table mapping character names to characters, used to interpret
|
||||
the character names found in KeyBindings dictionaries. */
|
||||
#define CHARACTER_TABLE_SIZE 77
|
||||
#define CHARACTER_TABLE_SIZE 78
|
||||
|
||||
static struct
|
||||
{
|
||||
|
@ -125,6 +125,7 @@ character_table[CHARACTER_TABLE_SIZE] =
|
|||
/* Special characters by name. Useful if you want, for example,
|
||||
to associate some special action to C-Tab or similar evils. */
|
||||
{ @"Backspace", NSBackspaceCharacter },
|
||||
{ @"BackTab", NSBackTabCharacter },
|
||||
{ @"Tab", NSTabCharacter },
|
||||
{ @"Enter", NSEnterCharacter },
|
||||
{ @"FormFeed", NSFormFeedCharacter },
|
||||
|
@ -654,6 +655,10 @@ static NSInputManager *currentInputManager = nil;
|
|||
[self doCommandBySelector: @selector (cancelOperation:)];
|
||||
break;
|
||||
|
||||
case NSBackTabCharacter:
|
||||
[self doCommandBySelector: @selector (insertBacktab:)];
|
||||
break;
|
||||
|
||||
case NSTabCharacter:
|
||||
if (flags & NSShiftKeyMask)
|
||||
{
|
||||
|
|
|
@ -2585,7 +2585,7 @@ static SEL getSel;
|
|||
unsigned int modifiers = [theEvent modifierFlags];
|
||||
int i;
|
||||
unsigned int relevantModifiersMask = NSCommandKeyMask | NSAlternateKeyMask | NSControlKeyMask;
|
||||
unichar key = ([keyEquivalent length] > 0 ? [keyEquivalent characterAtIndex:0] : 0);
|
||||
|
||||
/* Take shift key into account only for control keys and arrow and function keys */
|
||||
if ((modifiers & NSFunctionKeyMask)
|
||||
|| ([keyEquivalent length] > 0 && [[NSCharacterSet controlCharacterSet] characterIsMember:[keyEquivalent characterAtIndex:0]]))
|
||||
|
@ -3727,6 +3727,15 @@ static SEL getSel;
|
|||
}
|
||||
return;
|
||||
|
||||
case NSBackTabCharacter:
|
||||
if (_tabKeyTraversesCells)
|
||||
{
|
||||
if ([self _selectNextSelectableCellAfterRow: _selectedRow
|
||||
column: _selectedColumn])
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case NSTabCharacter:
|
||||
if (_tabKeyTraversesCells)
|
||||
{
|
||||
|
|
|
@ -3218,6 +3218,13 @@ resetCursorRectsForView(NSView *theView)
|
|||
return;
|
||||
}
|
||||
|
||||
// If this is a BACKTAB event, move to the previous key view
|
||||
if (character == NSTabCharacter)
|
||||
{
|
||||
[self selectPreviousKeyView: self];
|
||||
return;
|
||||
}
|
||||
|
||||
// If this is a TAB or TAB+SHIFT event, move to the next key view
|
||||
if (character == NSTabCharacter)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue