Inherits From:
Declared In:

Class Description

Allows selectors to be sent up the responder chain in response to keystrokes.

The exact behaviour is determined by a "key binding" dictionary which is loaded from a file named KeyBindings.dict in the application's main bundle. This can be overriden by a file in any of the applications library directories.

The dictionary uses the keyboard key as key and the selector as value. A tilde character preceeding the key name is interpreted as ALT modifier and a caret as CTRL modifier. Alternatively, the value can be another dictionary in which case this sub dictionary becomes active after the corresponding key was pressed. When a key not defined in the sub dictionary is pressed, the main dictionary becomes active again. If a sub directory contains the key "prompt" the corresponding value is displayed in the prompt field when the sub directory becomes active.

Example: Consider the following file:     
        n = "gotoNext:";
        "^x" = {    
            prompt = "x-tras";
            s = "save:";

If the user presses n the selector gotoNext: is sent. If the user presses CTRL-x the prompt field appears and shows the text "x-tras". Pressing s now results in the selector save: being sent.

Instance Variables

NSDictionary *toplevelKeyBindingDictionary;
NSDictionary *currentKeyBindingDictionary;
IBOutlet NSTextField *promptField;
IBOutlet NSView *referenceView;

toplevelKeyBindingDictionaryThis instance variable is private.
currentKeyBindingDictionaryThis instance variable is private.
promptFieldText field used to display prompts.
referenceViewPrompt field is kept at the same position relative to this view when the window is resized

Method Types

Assigning the reference view
- setReferenceView:
- referenceView

Instance Methods


- (NSView *)referenceView

No method description.


- (void)setReferenceView:(NSView *)aView

No method description.

Version 2.0 Copyright ©2002. All Rights Reserved.