| Package | feathers.utils.keyboard |
| Class | public class KeyToState |
| Inheritance | KeyToState Object |
| Product Version : | Feathers 3.2.0 |
KeyboardEvent listeners
automatically.
See also
| Property | Defined By | ||
|---|---|---|---|
| callback : Function
The function to call when the state is changed. | KeyToState | ||
| cancelKeyCode : uint
The key that will cancel the state change if the key is down. | KeyToState | ||
| currentState : String [read-only]
The current state of the utility. | KeyToState | ||
| downState : String
The value for the "down" state. | KeyToState | ||
| isEnabled : Boolean
May be set to false to disable state changes temporarily
until set back to true. | KeyToState | ||
| keyCode : uint
The key that will change the state of the target, when pressed. | KeyToState | ||
| keyLocation : uint
The location of the key that will change the state, when pressed. | KeyToState | ||
| target : IFocusDisplayObject
The target component that should change state when a key is pressed
or released. | KeyToState | ||
| upState : String
The value for the "up" state. | KeyToState | ||
| Method | Defined By | ||
|---|---|---|---|
KeyToState(target:IFocusDisplayObject = null, callback:Function = null)
Constructor. | KeyToState | ||
| callback | property |
callback:FunctionThe function to call when the state is changed.
The callback is expected to have the following signature:
function(currentState:String):void
public function get callback():Function public function set callback(value:Function):void| cancelKeyCode | property |
cancelKeyCode:uintThe key that will cancel the state change if the key is down.
The default value is flash.ui.Keyboard.ESCAPE.
public function get cancelKeyCode():uint public function set cancelKeyCode(value:uint):void| currentState | property |
currentState:String [read-only] The current state of the utility. May be different than the state of the target.
public function get currentState():String| downState | property |
downState:StringThe value for the "down" state.
The default value is feathers.controls.ButtonState.DOWN.
public function get downState():String public function set downState(value:String):void| isEnabled | property |
isEnabled:Boolean
May be set to false to disable state changes temporarily
until set back to true.
public function get isEnabled():Boolean public function set isEnabled(value:Boolean):void| keyCode | property |
keyCode:uintThe key that will change the state of the target, when pressed.
The default value is flash.ui.Keyboard.SPACE.
public function get keyCode():uint public function set keyCode(value:uint):void| keyLocation | property |
keyLocation:uint
The location of the key that will change the state, when pressed.
If uint.MAX_VALUE, then any key location is allowed.
The default value is uint.MAX_VALUE.
public function get keyLocation():uint public function set keyLocation(value:uint):voidSee also
| target | property |
target:IFocusDisplayObjectThe target component that should change state when a key is pressed or released.
public function get target():IFocusDisplayObject public function set target(value:IFocusDisplayObject):void| upState | property |
upState:StringThe value for the "up" state.
The default value is feathers.controls.ButtonState.UP.
public function get upState():String public function set upState(value:String):void| KeyToState | () | Constructor |
public function KeyToState(target:IFocusDisplayObject = null, callback:Function = null)Constructor.
Parameterstarget:IFocusDisplayObject (default = null) | |
callback:Function (default = null) |