| Package | net.flashpunk.utils |
| Class | public class Input |
| Inheritance | Input Object |
| Property | Defined By | ||
|---|---|---|---|
| keyString : String [static]
An updated string containing the last 100 characters pressed on the keyboard. | Input | ||
| lastKey : int [static]
The last key pressed. | Input | ||
| mouseCursor : String [static]
The mouse cursor. | Input | ||
| mouseDown : Boolean = false [static]
If the mouse button is down. | Input | ||
| mouseFlashX : int [static] [read-only]
The absolute mouse x position on the screen (unscaled). | Input | ||
| mouseFlashY : int [static] [read-only]
The absolute mouse y position on the screen (unscaled). | Input | ||
| mousePressed : Boolean = false [static]
If the mouse button was pressed this frame. | Input | ||
| mouseReleased : Boolean = false [static]
If the mouse button was released this frame. | Input | ||
| mouseUp : Boolean = true [static]
If the mouse button is up. | Input | ||
| mouseWheel : Boolean = false [static]
If the mouse wheel was moved this frame. | Input | ||
| mouseWheelDelta : int [static] [read-only]
If the mouse wheel was moved this frame, this was the delta. | Input | ||
| mouseX : int [static] [read-only]
X position of the mouse on the screen. | Input | ||
| mouseY : int [static] [read-only]
Y position of the mouse on the screen. | Input | ||
| Method | Defined By | ||
|---|---|---|---|
check(input:*):Boolean [static]
If the input or key is held down. | Input | ||
clear():void [static]
Clears all input states. | Input | ||
define(name:String, ... keys):void [static]
Defines a new input. | Input | ||
keys(name:String):Vector.<int> [static]
Returns the keys mapped to the input name. | Input | ||
pressed(input:*):Boolean [static]
If the input or key was pressed this frame. | Input | ||
released(input:*):Boolean [static]
If the input or key was released this frame. | Input | ||
| keyString | property |
public static var keyString:StringAn updated string containing the last 100 characters pressed on the keyboard. Useful for creating text input fields, such as highscore entries, etc.
| lastKey | property |
public static var lastKey:intThe last key pressed.
| mouseCursor | property |
public static var mouseCursor:StringThe mouse cursor. Set to "hide" to hide the cursor. See the flash.ui.MouseCursor class for a list of all other possible values. Common values: "auto" or "button".
| mouseDown | property |
public static var mouseDown:Boolean = falseIf the mouse button is down.
| mouseFlashX | property |
mouseFlashX:int [read-only] The absolute mouse x position on the screen (unscaled).
public static function get mouseFlashX():int| mouseFlashY | property |
mouseFlashY:int [read-only] The absolute mouse y position on the screen (unscaled).
public static function get mouseFlashY():int| mousePressed | property |
public static var mousePressed:Boolean = falseIf the mouse button was pressed this frame.
| mouseReleased | property |
public static var mouseReleased:Boolean = falseIf the mouse button was released this frame.
| mouseUp | property |
public static var mouseUp:Boolean = trueIf the mouse button is up.
| mouseWheel | property |
public static var mouseWheel:Boolean = falseIf the mouse wheel was moved this frame.
| mouseWheelDelta | property |
mouseWheelDelta:int [read-only] If the mouse wheel was moved this frame, this was the delta.
public static function get mouseWheelDelta():int| mouseX | property |
mouseX:int [read-only] X position of the mouse on the screen.
public static function get mouseX():int| mouseY | property |
mouseY:int [read-only] Y position of the mouse on the screen.
public static function get mouseY():int| check | () | method |
public static function check(input:*):BooleanIf the input or key is held down.
Parameters
input:* — An input name or key to check for.
|
Boolean — True or false.
|
| clear | () | method |
public static function clear():voidClears all input states.
| define | () | method |
public static function define(name:String, ... keys):voidDefines a new input.
Parameters
name:String — String to map the input to.
| |
... keys — The keys to use for the Input.
|
| keys | () | method |
public static function keys(name:String):Vector.<int>Returns the keys mapped to the input name.
Parameters
name:String — The input name.
|
Vector.<int> — A Vector of keys.
|
| pressed | () | method |
public static function pressed(input:*):BooleanIf the input or key was pressed this frame.
Parameters
input:* — An input name or key to check for.
|
Boolean — True or false.
|
| released | () | method |
public static function released(input:*):BooleanIf the input or key was released this frame.
Parameters
input:* — An input name or key to check for.
|
Boolean — True or false.
|