KeyboardEvent
A KeyboardEvent object id dispatched in response to user input through a keyboard. There are two types of keyboard events: KeyboardEvent.KEY_DOWN and KeyboardEvent.KEY_UP
Because mappings between keys and specific characters vary by device and operating system, use the TextEvent event type for processing character input.
To listen globally for key events, listen on the Stage for the capture and target or bubble phase.
Inherited from Event.
Can be created with method new:
Lib.Media.Events.KeyboardEvent.new(type, bubbles, cancelable, charCodeValue, keyCodeValue, keyLocationValue, ctrlKeyValue, altKeyValue, shiftKeyValue, controlKeyValue, commandKeyValue) |
Creates an Event object that contains specific information about keyboard events. |
type - The type of the event. Possible values are: KeyboardEvent.KEY_DOWN and KeyboardEvent.KEY_UP bubbles - (default = true) - Determines whether the Event object participates in the bubbling stage of the event flow. cancelable - (default = false) - Determines whether the Event object can be canceled. charCodeValue - (default = 0) - The character code value of the key pressed or released. keyCodeValue - (default = 0) - The key code value of the key pressed or released. keyLocationValue - (default = 0) - The location of the key on the keyboard. ctrlKeyValue - (default = false) - On Windows, indicates whether the Ctrl key is activated. On Mac, indicates whether either the Ctrl key or the Command key is activated. altKeyValue - (default = false) - Indicates whether the Alt key modifier is activated. shiftKeyValue - (default = false) - Indicates whether the Shift key modifier is activated. controlKeyValue - (default = false) - Indicates whether the Control key is activated on Mac, and whether the Control or Ctrl keys are activated on WIndows. commandKeyValue - (default = false) - Indicates whether the Command key is activated. |
Created KeyboardEvent object has properties:
altKey |
Indicates whether the Alt key is active (true) or inactive (false) on Windows; indicates whether the Option key is active on Mac OS. |
charCode |
Contains the character code value of the key pressed or released. |
commandKey |
Indicates whether the Command key is active (true) or inactive (false). |
controlKey |
Indicates whether the Control key is active (true) or inactive (false). |
ctrlKey |
On Windows and Linux, indicates whether the Ctrl key is active (true) or inactive (false); On Mac OS, indicates whether either the Ctrl key or the Command key is active. |
keyCode |
The key code value of the key pressed or released. |
keyLocation |
Indicates the location of the key on the keyboard. |
shiftKey |
Indicates whether the Shift key modifier is active (true) or inactive (false). |
methods:
clone() |
Creates a copy of the KeyboardEvent object and sets the value of each property to match that of the original. |
|
toString() |
Returns a string that contains all the properties of the KeyboardEvent object. |
|
Event types:
Lib.Media.Events.KeyboardEvent.KEY_DOWN |
The KeyboardEvent.KEY_DOWN constant defines the value of the type property of a keyDown event object. |
Lib.Media.Events.KeyboardEvent.KEY_UP |
The KeyboardEvent.KEY_UP constant defines the value of the type property of a keyUp event object. |
Created with the Personal Edition of HelpNDoc: Full-featured Help generator