| Package | feathers.utils.keyboard |
| Class | public class KeyToTrigger |
| Inheritance | KeyToTrigger KeyToEvent Object |
| Product Version : | Feathers 3.0.0 |
Event.TRIGGERED from the target when a key is
pressed and released and the target has focus. Conveniently handles all
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._keyToTrigger = new KeyToTrigger(this);
this._keyToTrigger.keyCode = Keyboard.ENTER;
}
private var _keyToTrigger:KeyToTrigger;
// ...Note: When combined with a KeyToSelect instance, the
KeyToTrigger instance should be created first because
Event.TRIGGERED should be dispatched before
Event.CHANGE.
See also
| Method | Defined By | ||
|---|---|---|---|
KeyToTrigger(target:IFocusDisplayObject = null, keyCode:uint)
Constructor. | KeyToTrigger | ||
| KeyToTrigger | () | Constructor |
public function KeyToTrigger(target:IFocusDisplayObject = null, keyCode:uint)Constructor.
Parameterstarget:IFocusDisplayObject (default = null) | |
keyCode:uint (default = NaN) |