diff --git a/KeyBindings/DefaultKeyBindings.dict b/KeyBindings/DefaultKeyBindings.dict index c0c76568d..4fc75d656 100644 --- a/KeyBindings/DefaultKeyBindings.dict +++ b/KeyBindings/DefaultKeyBindings.dict @@ -1,4 +1,6 @@ { /* -*-c-*- */ + /* Auto-Completion key */ + "Escape" = "complete:"; /* Function keys */ "UpArrow" = "moveUp:"; diff --git a/Source/NSInputManager.m b/Source/NSInputManager.m index d5a7cf9b1..63aa3b372 100644 --- a/Source/NSInputManager.m +++ b/Source/NSInputManager.m @@ -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; diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 7eb8be163..925914031 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -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