| Package | feathers.utils.keyboard |
| Class | public class KeyToEvent |
| Inheritance | KeyToEvent Object |
| Subclasses | KeyToTrigger |
| Product Version : | Feathers 3.4.0 |
KeyboardEvent listeners automatically.
In the following example, a custom item renderer will be triggered when a key is pressed and released:
public class CustomComponent extends FeathersControl implements IFocusDisplayObject
{
public function CustomComponent()
{
super();
this._keyToEvent = new KeyToEvent(this, Event.TRIGGERED);
this._keyToEvent.keyCode = Keyboard.SPACE;
}
private var _keyToEvent:KeyToEvent;
// ...See also
| Property | Defined By | ||
|---|---|---|---|
| cancelKeyCode : uint
The key that will cancel the event if the key is down. | KeyToEvent | ||
| eventType : String
The event type that will be dispatched when pressed. | KeyToEvent | ||
| isEnabled : Boolean
May be set to false to disable event dispatching
temporarily until set back to true. | KeyToEvent | ||
| keyCode : uint
The key that will dispatch the event, when pressed. | KeyToEvent | ||
| keyLocation : uint
The location of the key that will dispatch the event, when pressed. | KeyToEvent | ||
| target : IFocusDisplayObject
The target component that should be selected when a key is pressed. | KeyToEvent | ||
| Method | Defined By | ||
|---|---|---|---|
KeyToEvent(target:IFocusDisplayObject = null, keyCode:uint, eventType:String = null)
Constructor. | KeyToEvent | ||
| cancelKeyCode | property |
cancelKeyCode:uintThe key that will cancel the event 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| eventType | property |
eventType:StringThe event type that will be dispatched when pressed.
public function get eventType():String public function set eventType(value:String):void| isEnabled | property |
isEnabled:Boolean
May be set to false to disable event dispatching
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 dispatch the event, 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 dispatch the event, 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 be selected when a key is pressed.
public function get target():IFocusDisplayObject public function set target(value:IFocusDisplayObject):void| KeyToEvent | () | Constructor |
public function KeyToEvent(target:IFocusDisplayObject = null, keyCode:uint, eventType:String = null)Constructor.
Parameterstarget:IFocusDisplayObject (default = null) | |
keyCode:uint (default = NaN) | |
eventType:String (default = null) |