Inherits from NSObject
Declared in ViKeyManager.h

Overview

The key manager handles key input and macro evaluation.

The key manager uses a ViParser to parse key events into a ViCommand.

Tasks

Other Methods

Initializing

Handling key events

Properties

parser

The vi key parser. See ViParser.

@property (nonatomic, readwrite, assign) ViParser *parser

Declared In

ViKeyManager.h

target

The target object that evaluates the parsed commands. Should conform to the ViKeyManagerTarget protocol.

@property (nonatomic, readwrite, assign) id<ViKeyManagerTarget> target

Declared In

ViKeyManager.h

Instance Methods

handleKey:

Manually parse a key.

- (BOOL)handleKey:(NSInteger)keyCode

Parameters

keyCode

The key code of the key.

Declared In

ViKeyManager.h

handleKey:inScope:

Manually parse a key.

- (BOOL)handleKey:(NSInteger)keyCode inScope:(ViScope *)scope

Parameters

keyCode

The key code of the key.

scope

The scope to consider when parsing the key.

Declared In

ViKeyManager.h

initWithTarget:defaultMap:

Initialize a new key manager with a target object and a default key map.

- (ViKeyManager *)initWithTarget:(id<ViKeyManagerTarget>)aTarget defaultMap:(ViMap *)map

Parameters

aTarget

The target of generated commands.

map

The default map to use when creating a new key parser.

Declared In

ViKeyManager.h

initWithTarget:parser:

Initialize a new key manager with a target object and a key parser.

- (ViKeyManager *)initWithTarget:(id<ViKeyManagerTarget>)aTarget parser:(ViParser *)aParser

Parameters

aTarget

The target of generated commands.

aParser

An existing key parser.

Discussion

This is the designated initialzer.

Declared In

ViKeyManager.h

keyDown:

Handle a keyDown event.

- (void)keyDown:(NSEvent *)theEvent

Parameters

theEvent

A key event.

Declared In

ViKeyManager.h

keyDown:inScope:

Handle a keyDown event.

- (void)keyDown:(NSEvent *)theEvent inScope:(ViScope *)scope

Parameters

theEvent

A key event.

scope

The scope where the key event occurred.

Declared In

ViKeyManager.h

performKeyEquivalent:

Handle a key equivalent event.

- (BOOL)performKeyEquivalent:(NSEvent *)theEvent

Parameters

theEvent

A key equivalent event.

Return Value

YES if the key equivalent was handled. NO if the key equivalent was not recognized.

Declared In

ViKeyManager.h

performKeyEquivalent:inScope:

Handle a key equivalent event.

- (BOOL)performKeyEquivalent:(NSEvent *)theEvent inScope:(ViScope *)scope

Parameters

theEvent

A key equivalent event.

scope

The scope where the key equivalent event occurred.

Return Value

YES if the key equivalent was handled. NO if the key equivalent was not recognized.

Declared In

ViKeyManager.h