Method | Defined by | ||
---|---|---|---|
FlxInput()
Constructor
| FlxInput | ||
addKey(KeyName:String, KeyCode:uint):void
An internal helper function used to build the key array.
| FlxInput | ||
handleKeyDown(event:KeyboardEvent):void
Event handler so FlxGame can toggle keys.
| FlxInput | ||
handleKeyUp(event:KeyboardEvent):void
Event handler so FlxGame can toggle keys.
| FlxInput | ||
justPressed(Key:String):Boolean
Check to see if this key was just pressed.
| FlxInput | ||
justReleased(Key:String):Boolean
Check to see if this key is just released.
| FlxInput | ||
pressed(Key:String):Boolean
Check to see if this key is pressed.
| FlxInput | ||
reset():void
Resets all the keys.
| FlxInput | ||
update():void
Updates the key states (for tracking just pressed, just released, etc).
| FlxInput |
FlxInput | () | constructor |
public function FlxInput()
Constructor
addKey | () | method |
public function addKey(KeyName:String, KeyCode:uint):void
An internal helper function used to build the key array.
ParametersKeyName:String — String name of the key (e.g. "LEFT" or "A")
|
|
KeyCode:uint — The numeric Flash code for this key.
|
handleKeyDown | () | method |
public function handleKeyDown(event:KeyboardEvent):void
Event handler so FlxGame can toggle keys.
Parametersevent:KeyboardEvent — A KeyboardEvent object.
|
handleKeyUp | () | method |
public function handleKeyUp(event:KeyboardEvent):void
Event handler so FlxGame can toggle keys.
Parametersevent:KeyboardEvent — A KeyboardEvent object.
|
justPressed | () | method |
public function justPressed(Key:String):Boolean
Check to see if this key was just pressed.
ParametersKey:String — One of the key constants listed above (e.g. "LEFT" or "A").
|
Boolean — Whether the key was just pressed
|
justReleased | () | method |
public function justReleased(Key:String):Boolean
Check to see if this key is just released.
ParametersKey:String — One of the key constants listed above (e.g. "LEFT" or "A").
|
Boolean — Whether the key is just released.
|
pressed | () | method |
public function pressed(Key:String):Boolean
Check to see if this key is pressed.
ParametersKey:String — One of the key constants listed above (e.g. "LEFT" or "A").
|
Boolean — Whether the key is pressed
|
reset | () | method |
public function reset():void
Resets all the keys.
update | () | method |
public function update():void
Updates the key states (for tracking just pressed, just released, etc).