mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-24 06:28:54 +00:00
Remove hardcoded escape key processing in NSTextView.m:keyDown method added previously, add binding processing code for escape key, add default escape key binding to complete: method
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@37037 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6f19ceff5f
commit
3ed2a612ad
3 changed files with 6 additions and 14 deletions
|
@ -1,4 +1,6 @@
|
|||
{ /* -*-c-*- */
|
||||
/* Auto-Completion key */
|
||||
"Escape" = "complete:";
|
||||
|
||||
/* Function keys */
|
||||
"UpArrow" = "moveUp:";
|
||||
|
|
|
@ -39,14 +39,13 @@
|
|||
|
||||
/* A table mapping character names to characters, used to interpret
|
||||
the character names found in KeyBindings dictionaries. */
|
||||
#define CHARACTER_TABLE_SIZE 78
|
||||
|
||||
static struct
|
||||
{
|
||||
NSString *name;
|
||||
unichar character;
|
||||
}
|
||||
character_table[CHARACTER_TABLE_SIZE] =
|
||||
character_table[] =
|
||||
{
|
||||
/* Function keys. */
|
||||
{ @"UpArrow", NSUpArrowFunctionKey },
|
||||
|
@ -129,8 +128,10 @@ character_table[CHARACTER_TABLE_SIZE] =
|
|||
{ @"Tab", NSTabCharacter },
|
||||
{ @"Enter", NSEnterCharacter },
|
||||
{ @"FormFeed", NSFormFeedCharacter },
|
||||
{ @"CarriageReturn", NSCarriageReturnCharacter }
|
||||
{ @"CarriageReturn", NSCarriageReturnCharacter },
|
||||
{ @"Escape", 0x1b }
|
||||
};
|
||||
static int CHARACTER_TABLE_SIZE = (sizeof(character_table) / sizeof(character_table[0]));
|
||||
|
||||
static NSInputManager *currentInputManager = nil;
|
||||
|
||||
|
|
|
@ -5920,20 +5920,9 @@ static const NSInteger GSSpellingSuggestionMenuItemTag = 1;
|
|||
[super keyDown: theEvent];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *string = [theEvent characters];
|
||||
|
||||
// TEMPORARY...
|
||||
// Invoke autocompletion on ESCAPE...
|
||||
if (([string length] == 1) && ([string characterAtIndex: 0] == 0x1B))
|
||||
{
|
||||
[self complete: self];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self interpretKeyEvents: [NSArray arrayWithObject: theEvent]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Bind other mouse up to pasteSelection. This should be done via
|
||||
|
|
Loading…
Reference in a new issue