class org.aswing.KeyboardManager extends EventDispatcher

Dispatched when key is down. @eventType flash.events.KeyboardEvent.KEY_DOWN

Class Fields

static function setDefaultMnemonicModifier(keyCodes:Array<Dynamic>): Void

Instance Fields

Show inherited public instance fieldsHide inherited public instance fields

Inherited from EventDispatcher

function addEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool, ?priority:Int, ?useWeakReference:Bool):Void
function dispatchEvent(event:Event):Bool
function hasEventListener(type:String):Bool
function removeEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool):Void
function toString():String
function willTrigger(type:String):Bool

function new(): Void

Singleton class, Don't create instance directly, in stead you should call getInstance().

function getKeyMap(): KeyMap

function init(root:DisplayObjectContainer): Void

Init the keyboad manager, it will only start works when it is inited.

root

the key trigger root of this keyboard manager.

function isEnabled(): Bool

function isKeyDown(keyCode:Int): Bool

Returns whether or not the key is down.

the

key code

returns

true if the specified key is down, false if not.

function isKeyJustActed(): Bool

Returns whether or not just a key action acted when the last key down.

returns

true if there's key actions acted at last key down, false not.

function isMnemonicModifierDown(): Bool

Returns whether or not the mnemonic modifier keys is down.

returns

whether or not the mnemonic modifier keys is down.

function registerKeyAction(key:KeyType, action:Dynamic ->Void): Void

Registers a key action to the default key map of this controller. @see KeyMap#registerKeyAction()

key

the key type

action

the action

function setEnabled(b:Bool): Void

function setMnemonicModifier(keyCodes:Array<Dynamic>): Void

Sets the mnemonic modifier key codes, the default is [Ctrl, Shift], however for normal UI frameworks, it is [Alt], but because the flashplayer or explorer will eat [Alt] for thier own mnemonic modifier, so we set our default to [Ctrl, Shift].

Sets null to make it allways keep same to getDefaultMnemonicModifier

keyCodes

the array of key codes to be the mnemoic modifier.

function unregisterKeyAction(key:KeyType): Void

Unregisters a key action to the default key map of this controller. @see KeyMap#unregisterKeyAction()

key

the key type