KeyboardEvent class

An Event that is dispatched in response to user input through a keyboard.

There are two types of keyboard events:

Inheritance

Constructors

KeyboardEvent(String type, bool bubbles, int keyCode, KeyLocation keyLocation, bool altKey, bool ctrlKey, bool shiftKey)
Creates a new KeyboardEvent.

Properties

altKey bool
Indicates whether the Alt key is active (true) or inactive (false) on Windows; indicates whether the Option key is active on Mac OS.
final
bubbles bool
Indicates whether an event is a bubbling event. If the event can bubble, this value is true; otherwise it is false. [...]
read-only, inherited
captures bool
Indicates whether an event is a capturing event.
read-only, inherited
ctrlKey bool
Indicates whether the Ctrl key is active (true) or inactive (false).
final
currentTarget EventDispatcher
The object that is actively processing the Event object with an event listener. [...]
read-only, inherited
eventPhase EventPhase
The current phase in the event flow. [...]
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
isDefaultPrevented bool
read-only
isImmediatePropagationStopped bool
Indicates if the propagation of this event has been stopped. [...]
read-only, inherited
isPropagationStopped bool
Indicates if the propagation of this event has been stopped. [...]
read-only, inherited
keyCode int
The key code value of the key pressed or released.
final
keyLocation KeyLocation
Indicates the location of the key on the keyboard. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
shiftKey bool
Indicates whether the Shift key is active (true) or inactive (false).
final
target EventDispatcher
The event target. [...]
read-only, inherited
type String
The type of event.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
preventDefault() → void
stopImmediatePropagation() → void
Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow. [...]
inherited
stopPropagation() → void
Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Constants

KEY_DOWN → const String
'keyDown'
KEY_UP → const String
'keyUp'