| Package | gs.util |
| Class | public class KeyHandler |
Examples are in the guttershark repository.
Supported Key Shortcuts for Key Sequences
| Property | Defined by | ||
|---|---|---|---|
| autoTarget : DisplayObject [write-only]
A display object that toggles enabled / disabled when it's
added / removed from the stage.
| KeyHandler | ||
| enabled : Boolean
Whether or not this key handler should fire.
| KeyHandler | ||
| Method | Defined by | ||
|---|---|---|---|
|
KeyHandler(shortcut:String, callback:Function)
Constructor for KeyHandler instances.
| KeyHandler | ||
|
disable(id:String):void
[static]
Disable a key handler.
| KeyHandler | ||
|
dispose():void
Dispose of this key handler.
| KeyHandler | ||
|
enable(id:String):void
[static]
Enable a key handler.
| KeyHandler | ||
|
get(id:String):KeyHandler
[static]
Get a key handler instance.
| KeyHandler | ||
|
set(id:String, kh:KeyHandler):void
[static]
Set a key handler instance.
| KeyHandler | ||
|
unset(id:String):void
[static]
Unset (delete) a key handler.
| KeyHandler | ||
| autoTarget | property |
autoTarget:DisplayObject [write-only]A display object that toggles enabled / disabled when it's added / removed from the stage.
Implementation public function set autoTarget(value:DisplayObject):void
| enabled | property |
enabled:Boolean [read-write]Whether or not this key handler should fire.
Implementation public function get enabled():Boolean
public function set enabled(value:Boolean):void
| KeyHandler | () | constructor |
public function KeyHandler(shortcut:String, callback:Function)Constructor for KeyHandler instances.
Parametersshortcut:String — The key shortcut to install.
|
|
callback:Function — A callback function to execute when the key sequence is pressed.
|
| disable | () | method |
public static function disable(id:String):voidDisable a key handler.
Parametersid:String — The key handler id.
|
| dispose | () | method |
public function dispose():voidDispose of this key handler.
| enable | () | method |
public static function enable(id:String):voidEnable a key handler.
Parametersid:String — The key handler id.
|
| get | () | method |
public static function get(id:String):KeyHandlerGet a key handler instance.
Parametersid:String — The key handler id.
|
KeyHandler |
| set | () | method |
public static function set(id:String, kh:KeyHandler):voidSet a key handler instance.
Parametersid:String — An id for the key handler.
|
|
kh:KeyHandler — The key handler.
|
| unset | () | method |
public static function unset(id:String):voidUnset (delete) a key handler.
Parametersid:String — The key handler id.
|