Package | org.flixel.system.input |
Class | public class Input |
Inheritance | Input Object |
Subclasses | Keyboard |
Method | Defined By | ||
---|---|---|---|
Input()
Constructor
| Input | ||
any():Boolean
Check to see if any keys are pressed right now. | Input | ||
destroy():void
Clean up memory. | Input | ||
getKeyCode(KeyName:String):int
Look up the key code for any given string name of the key or button. | Input | ||
justPressed(Key:String):Boolean
Check to see if this key was just pressed. | Input | ||
justReleased(Key:String):Boolean
Check to see if this key is just released. | Input | ||
playback(Record:Array):void
Part of the keystroke recording system. | Input | ||
pressed(Key:String):Boolean
Check to see if this key is pressed. | Input | ||
record():Array
If any keys are not "released" (0),
this function will return an array indicating
which keys are pressed and what state they are in. | Input | ||
reset():void
Resets all the keys. | Input | ||
update():void
Updates the key states (for tracking just pressed, just released, etc). | Input |
Method | Defined By | ||
---|---|---|---|
addKey(KeyName:String, KeyCode:uint):void
An internal helper function used to build the key array. | Input |
Input | () | Constructor |
public function Input()
Constructor
addKey | () | method |
protected function addKey(KeyName:String, KeyCode:uint):void
An internal helper function used to build the key array.
Parameters
KeyName:String — String name of the key (e.g. "LEFT" or "A")
| |
KeyCode:uint — The numeric Flash code for this key.
|
any | () | method |
public function any():Boolean
Check to see if any keys are pressed right now.
ReturnsBoolean — Whether any keys are currently pressed.
|
destroy | () | method |
public function destroy():void
Clean up memory.
getKeyCode | () | method |
public function getKeyCode(KeyName:String):int
Look up the key code for any given string name of the key or button.
Parameters
KeyName:String — The String name of the key.
|
int — The key code for that key.
|
justPressed | () | method |
public function justPressed(Key:String):Boolean
Check to see if this key was just pressed.
Parameters
Key: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.
Parameters
Key:String — One of the key constants listed above (e.g. "LEFT" or "A").
|
Boolean — Whether the key is just released.
|
playback | () | method |
public function playback(Record:Array):void
Part of the keystroke recording system. Takes data about key presses and sets it into array.
Parameters
Record:Array — Array of data about key states.
|
pressed | () | method |
public function pressed(Key:String):Boolean
Check to see if this key is pressed.
Parameters
Key:String — One of the key constants listed above (e.g. "LEFT" or "A").
|
Boolean — Whether the key is pressed
|
record | () | method |
public function record():Array
If any keys are not "released" (0), this function will return an array indicating which keys are pressed and what state they are in.
ReturnsArray — An array of key state data. Null if there is no data.
|
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).