KeyboardEvent
public class
loom2d.events.KeyboardEvent
Description
A KeyboardEvent is dispatched in response to user input through a keyboard.
This is Starling's version of the Flash KeyboardEvent class. It contains the same properties as the Flash equivalent.
To be notified of keyboard events, add an event listener to the Starling stage. Children of the stage won't be notified of keybaord input. Starling has no concept of a "Focus" like native Flash.
See also:
loom2d.display.Stage
API overview
Constructor
KeyboardEvent
(
type: String
,
charCode: Number
= 0
,
keyCode: Number
= 0
,
keyLocation: Number
= 0
,
ctrlKey: Boolean
= false
,
altKey: Boolean
= false
,
shiftKey: Boolean
= false
)
Creates a new KeyboardEvent
Attributes
Public attributes
altKey: Boolean |
read-only
Indicates whether the Alt key is active on Windows or Linux; indicates whether the Option key is active on Mac OS |
charCode: Number |
read-only
Contains the character code of the key |
ctrlKey: Boolean |
read-only
Indicates whether the Ctrl key is active on Windows or Linux; indicates whether either the Ctrl or the Command key is active on Mac OS |
keyCode: Number |
read-only
The key code of the key |
keyLocation: Number |
read-only
Indicates the location of the key on the keyboard |
shiftKey: Boolean |
read-only
Indicates whether the Shift key modifier is active (true) or inactive (false) |
Constructor
Attributes
altKey: Boolean
read-only
Indicates whether the Alt key is active on Windows or Linux; indicates whether the Option key is active on Mac OS.
ctrlKey: Boolean
read-only
Indicates whether the Ctrl key is active on Windows or Linux; indicates whether either the Ctrl or the Command key is active on Mac OS.
currentTarget: EventDispatcher
Inherited from Event
read-only
The object the event is currently bubbling at.
keyLocation: Number
read-only
Indicates the location of the key on the keyboard. This is useful for differentiating
keys that appear more than once on a keyboard. See also:
Keylocation
shiftKey: Boolean
read-only
Indicates whether the Shift key modifier is active (true) or inactive (false).
Constants
CANCEL: String
static
An event type to be utilized in custom events. Not used by Starling right now.
CHANGE: String
static
An event type to be utilized in custom events. Not used by Starling right now.
REMOVE_FROM_JUGGLER: String
static
Event type for an animated object that requests to be removed from the juggler.
SCROLL: String
static
An event type to be utilized in custom events. Not used by Starling right now.
SELECT: String
static
An event type to be utilized in custom events. Not used by Starling right now.
Functions
getFullTypeName
(): String
Inherited from Object
native
Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.
Returns
String | fully qualified type name of the Object. |
getType
(): Type
Inherited from Object
native
Gets the Type that describes the Object.
Returns
Type | The Type that describes the object. |
getTypeName
(): String
Inherited from Object
native
Gets the type name of the Object.
Returns
String | type name of the Object. |
stopImmediatePropagation
(): Void
Inherited from Event
Prevents any other listeners from receiving the event.