KeyCode class
Represents a key pressed on the keyboard. This class is used for the legacy key events as well the enhanced key events. used on the Kitty protocol.
Note: need to have KeyboardEnhancementFlags.disambiguateEscapeCodes enabled to media and/or modifiers to be populated.
- Annotations
-
- @immutable
Constructors
- KeyCode({KeyCodeName name = KeyCodeName.none, String char = '', MediaKeyCode media = MediaKeyCode.none, ModifierKeyCode modifiers = ModifierKeyCode.none, int baseLayoutKey = 0})
-
Constructs a new instance of KeyCode.
const
Properties
- baseLayoutKey → int
-
Base layout key
final
- char → String
-
Contains the character of the key if is a printable character.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- media → MediaKeyCode
-
Contains the media key code if is a media key (play, pause, etc).
final
- modifiers → ModifierKeyCode
-
Contains the modifiers applied to the key (shift, ctrl, alt, etc).
final
- name → KeyCodeName
-
Contains the name of the key if is a named key (enter, esc, pgUp, etc).
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, thetoString
method will be overridden to output this instance'sprops
.no setterinherited
Methods
-
copyWith(
{KeyCodeName? name, String? char, MediaKeyCode? media, ModifierKeyCode? modifiers, int? baseLayoutKey}) → KeyCode - Create a new instance of KeyCode with the given parameters.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String - A string representation of this object.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited