KeyboardEvent class

An event that describes user interaction with the keyboard.

The type of the event identifies what kind of interaction occurred.

See also:

Inheritance
Implemented by
Annotations
  • @DomName('KeyboardEvent')
  • @Native("KeyboardEvent")

Constructors

KeyboardEvent(String type, { Window view, bool canBubble: true, bool cancelable: true, int location, int keyLocation, bool ctrlKey: false, bool altKey: false, bool shiftKey: false, bool metaKey: false })
Programmatically create a KeyboardEvent. [...]
factory

Properties

altKey bool
@DocsEditable(), @DomName('KeyboardEvent.altKey'), final
charCode int
@DomName('KeyboardEvent.charCode'), final
code String
@DocsEditable(), @DomName('KeyboardEvent.code'), @Experimental(), final
ctrlKey bool
@DocsEditable(), @DomName('KeyboardEvent.ctrlKey'), final
isComposing bool
@DocsEditable(), @DomName('KeyboardEvent.isComposing'), @Experimental(), final
key String
@DocsEditable(), @DomName('KeyboardEvent.key'), @Experimental(), final
keyCode int
@DomName('KeyboardEvent.keyCode'), final
location int
@DocsEditable(), @DomName('KeyboardEvent.location'), @Experimental(), final
metaKey bool
@DocsEditable(), @DomName('KeyboardEvent.metaKey'), final
repeat bool
@DocsEditable(), @DomName('KeyboardEvent.repeat'), @Experimental(), final
shiftKey bool
@DocsEditable(), @DomName('KeyboardEvent.shiftKey'), final
which int
@DomName('KeyboardEvent.which'), read-only
bubbles bool
@DocsEditable(), @DomName('Event.bubbles'), final, inherited
cancelable bool
@DocsEditable(), @DomName('Event.cancelable'), final, inherited
composed bool
@DocsEditable(), @DomName('Event.composed'), @Experimental(), final, inherited
currentTarget EventTarget
@DocsEditable(), @DomName('Event.currentTarget'), read-only, inherited
defaultPrevented bool
@DocsEditable(), @DomName('Event.defaultPrevented'), final, inherited
detail int
@DocsEditable(), @DomName('UIEvent.detail'), final, inherited
eventPhase int
@DocsEditable(), @DomName('Event.eventPhase'), final, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
isTrusted bool
@DocsEditable(), @DomName('Event.isTrusted'), @Experimental(), final, inherited
matchingTarget Element
A pointer to the element whose CSS selector matched within which an event was fired. If this Event was not associated with any Event delegation, accessing this value will throw an UnsupportedError.
read-only, inherited
path List<EventTarget>
@DocsEditable(), @DomName('Event.path'), @Experimental(), read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
sourceCapabilities InputDeviceCapabilities
@DocsEditable(), @DomName('UIEvent.sourceCapabilities'), @Experimental(), final, inherited
target EventTarget
@DocsEditable(), @DomName('Event.target'), read-only, inherited
timeStamp num
@DocsEditable(), @DomName('Event.timeStamp'), final, inherited
type String
@DocsEditable(), @DomName('Event.type'), final, inherited
view WindowBase
@DocsEditable(), @DomName('UIEvent.view'), read-only, inherited

Methods

getModifierState(String keyArg) bool
@DocsEditable(), @DomName('KeyboardEvent.getModifierState'), @Experimental()
composedPath() List<EventTarget>
@DocsEditable(), @DomName('Event.composedPath'), @Experimental(), inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
preventDefault() → void
@DocsEditable(), @DomName('Event.preventDefault'), inherited
stopImmediatePropagation() → void
@DocsEditable(), @DomName('Event.stopImmediatePropagation'), inherited
stopPropagation() → void
@DocsEditable(), @DomName('Event.stopPropagation'), inherited
toString() String
Returns a string representation of this object.
inherited

Operators

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

Constants

DOM_KEY_LOCATION_LEFT → const int
@DocsEditable(), @DomName('KeyboardEvent.DOM_KEY_LOCATION_LEFT'), @Experimental()
0x01
DOM_KEY_LOCATION_NUMPAD → const int
@DocsEditable(), @DomName('KeyboardEvent.DOM_KEY_LOCATION_NUMPAD'), @Experimental()
0x03
DOM_KEY_LOCATION_RIGHT → const int
@DocsEditable(), @DomName('KeyboardEvent.DOM_KEY_LOCATION_RIGHT'), @Experimental()
0x02
DOM_KEY_LOCATION_STANDARD → const int
@DocsEditable(), @DomName('KeyboardEvent.DOM_KEY_LOCATION_STANDARD'), @Experimental()
0x00