KeyEvent class final

Represent a Key event.

Inheritance
Annotations
  • @immutable

Constructors

KeyEvent(KeyCode code, {KeyModifiers modifiers = KeyModifiers.none, KeyEventType eventType = KeyEventType.keyPress, String? text})
Constructs a new instance of KeyEvent.
const
KeyEvent.fromString(String spec)
Parses a key specification string into a KeyEvent.
factory

Properties

code KeyCode
The key code.
final
eventType KeyEventType
The type of the event.
final
hashCode int
The hash code for this object.
no setteroverride
modifiers KeyModifiers
The key modifiers that could have been pressed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String?
The literal text this keystroke typed, as reported by the terminal's text-as-codepoints field. Null when the terminal did not report it.
final

Methods

copyWith({KeyCode? code, KeyModifiers? modifiers, KeyEventType? eventType, String? text}) KeyEvent
Creates a copy of this KeyEvent with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toBaseLayoutSpec() String?
Converts this KeyEvent to a specification string projected onto the base (standard US PC-101) layout key, substituting Kitty's alternate-key "base layout key" field for the character that was actually typed.
toSpec() String
Converts this KeyEvent to a specification string.
toString() String
A string representation of this object.
override

Operators

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