Packageorg.flixel.system.input
Classpublic class Input
InheritanceInput Inheritance Object
Subclasses Keyboard

Basic input class that manages the fast-access Booleans and detailed key-state tracking. Keyboard extends this with actual specific key data.



Public Methods
 MethodDefined By
  
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
Protected Methods
 MethodDefined By
  
addKey(KeyName:String, KeyCode:uint):void
An internal helper function used to build the key array.
Input
Constructor Detail
Input()Constructor
public function Input()

Constructor

Method Detail
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.

Returns
Boolean — 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.

Returns
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").

Returns
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").

Returns
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").

Returns
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.

Returns
Array — 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).