Packageorg.aswing
Classpublic class KeyMap

KeyMap is a key definition -> action map.

See also

org.aswing.KeyDefinition


Public Methods
 MethodDefined by
  
Creates a key map.
KeyMap
  
containsKey(key:KeyType):Boolean
Returns whether the key definition is already registered.
KeyMap
  
fireKeyAction(keySequence:Array):Boolean
Fires a key action with key sequence.
KeyMap
  
getCodec(key:KeyType):String
[static] Returns the codec of a key definition, same codec means same key definitions.
KeyMap
  
getCodecWithKeySequence(keySequence:Array):String
[static] Returns the codec of a key sequence.
KeyMap
  
getKeyAction(key:KeyType):Function
Returns the action from the key defintion.
KeyMap
  
registerKeyAction(key:KeyType, action:Function):void
Registers a key definition -> action pair to the map.
KeyMap
  
Unregisters a key and its action value.
KeyMap
Constructor detail
KeyMap()constructor
public function KeyMap()

Creates a key map.

Method detail
containsKey()method
public function containsKey(key:KeyType):Boolean

Returns whether the key definition is already registered.

Parameters
key:KeyType — the key definition

Returns
Boolean
fireKeyAction()method 
public function fireKeyAction(keySequence:Array):Boolean

Fires a key action with key sequence.

Parameters
keySequence:Array

Returns
Boolean — whether or not a key action fired with this key sequence.
getCodec()method 
public static function getCodec(key:KeyType):String

Returns the codec of a key definition, same codec means same key definitions.

Parameters
key:KeyType — the key definition

Returns
String — the codec of specified key definition
getCodecWithKeySequence()method 
public static function getCodecWithKeySequence(keySequence:Array):String

Returns the codec of a key sequence.

Parameters
keySequence:Array — the key sequence

Returns
String — the codec of specified key sequence
getKeyAction()method 
public function getKeyAction(key:KeyType):Function

Returns the action from the key defintion.

Parameters
key:KeyType — the key definition

Returns
Function — the action.

See also

registerKeyAction()method 
public function registerKeyAction(key:KeyType, action:Function):void

Registers a key definition -> action pair to the map. If same key definition is already in the map, it will be replaced with the new one.

Parameters
key:KeyType — the key definition.
 
action:Function — the aciton function
unregisterKeyAction()method 
public function unregisterKeyAction(key:KeyType):void

Unregisters a key and its action value.

Parameters
key:KeyType — the key and its value to be unrigesterd.