KeyboardEvent class
Represents a keyboard event.
Constructors
- KeyboardEvent({required LogicalKey logicalKey, String? character, ModifierKeys modifiers = const ModifierKeys()})
-
const
Properties
- character → String?
-
The character representation of the key, if applicable.
This will be null for non-character keys like arrows or function keys.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAltPressed → bool
-
no setter
- isControlPressed → bool
-
Convenience getters for modifier states.
no setter
- isMetaPressed → bool
-
no setter
- isShiftPressed → bool
-
no setter
- logicalKey → LogicalKey
-
The logical key that was pressed.
final
- modifiers → ModifierKeys
-
The state of modifier keys during this event.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
matches(
LogicalKey key, {bool? ctrl, bool? shift, bool? alt, bool? meta}) → bool - Check if this event matches a specific key with optional modifiers.
-
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