KeyEvent class

Represents a keyboard input event with optional modifier keys.

Constructors

KeyEvent({required KeyCode code, String? char, bool isShiftPressed = false, bool isAltPressed = false, bool isCtrlPressed = false, bool isMetaPressed = false})
Creates a KeyEvent.
const

Properties

char String?
The character produced by the key press, or null for non-character keys.
final
code KeyCode
The key code identifying which key was pressed.
final
hashCode int
The hash code for this object.
no setterinherited
isAltPressed bool
Whether the alt modifier is pressed.
final
isCtrlPressed bool
Whether the ctrl modifier is pressed.
final
isMetaPressed bool
Whether the meta modifier is pressed.
final
isShiftPressed bool
Whether the shift modifier is pressed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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