Packageorg.flixel.data
Classpublic class FlxInput
SubclassesFlxGamepad, FlxKeyboard



Public Methods
 MethodDefined by
  
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
Constructor detail
FlxInput()constructor
public function FlxInput()

Constructor

Method detail
addKey()method
public 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.
handleKeyDown()method 
public function handleKeyDown(event:KeyboardEvent):void

Event handler so FlxGame can toggle keys.

Parameters
event:KeyboardEvent — A KeyboardEvent object.
handleKeyUp()method 
public function handleKeyUp(event:KeyboardEvent):void

Event handler so FlxGame can toggle keys.

Parameters
event:KeyboardEvent — A KeyboardEvent object.
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.
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
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).