VtKeyEncoder class final

Terminal key encoder.

Converts VtKeyEvent objects into the byte sequences expected by terminal applications, supporting legacy, xterm, and Kitty keyboard protocol modes.

final encoder = VtKeyEncoder();
encoder.kittyFlags = GhosttyKittyFlags.disambiguate;

final event = VtKeyEvent();
event
  ..action = GhosttyKeyAction.GHOSTTY_KEY_ACTION_PRESS
  ..key = GhosttyKey.GHOSTTY_KEY_A
  ..utf8Text = 'a';

final bytes = encoder.encode(event);
terminal.writeBytes(bytes);

event.close();
encoder.close();

Constructors

VtKeyEncoder()

Properties

altEscPrefix bool
DEC mode 1036: alt sends escape prefix.
no getter
cursorKeyApplication bool
DEC mode 1: cursor key application mode.
no getter
hashCode int
The hash code for this object.
no setterinherited
ignoreKeypadWithNumLock bool
DEC mode 1035: ignore keypad with numlock.
no getter
keypadKeyApplication bool
DEC mode 66: keypad key application mode.
no getter
kittyFlags int
Kitty keyboard protocol flags.
no getter
macosOptionAsAlt GhosttyOptionAsAlt
macOS option-as-alt behavior.
no getter
modifyOtherKeysState2 bool
xterm modifyOtherKeys mode 2.
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Releases key encoder resources.
encode(VtKeyEvent event) Uint8List
Encodes a key event into terminal bytes.
encodeToString(VtKeyEvent event) String
Encodes a key event to a single Dart string of byte code units.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setOptionsFromTerminal(VtTerminal terminal) → void
Copies key encoder options from a terminal instance.
toString() String
A string representation of this object.
inherited

Operators

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