Keys class abstract final

Key constants and utilities for keyboard input handling.

This class provides:

  • Raw byte constants for low-level input handling
  • Key object constants for high-level TUI use
  • Helper methods for character classification
// High-level Key objects (for TUI)
if (key == Keys.enter) { ... }
if (key == Keys.ctrlC) { ... }

// Low-level byte constants
if (byte == Keys.enterByte) { ... }

// Helper methods
if (Keys.isPrintable(byte)) { ... }
if (Keys.isControlChar(byte)) { ... }

Properties

hashCode → int
The hash code for this object.
no setterinherited
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.
inherited

Operators

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

Static Methods

alt(String c) → Key
Creates an Alt+key combination.
char(String c) → Key
Creates a key for a single character.
charToCtrl(String char) → int?
Converts a letter character to its Ctrl+letter byte value.
ctrl(String c) → Key
Creates a Ctrl+key combination.
ctrlToChar(int byte) → String?
Converts a Ctrl+letter byte to the letter character.
isAlphanumeric(int byte) → bool
Whether byte is alphanumeric (letter or digit).
isControlChar(int byte) → bool
Whether byte is a control character (0x00-0x1F or 0x7F).
isDigit(int byte) → bool
Whether byte is an ASCII digit (0-9).
isEscape(int byte) → bool
Whether byte is the escape character.
isLetter(int byte) → bool
Whether byte is an ASCII letter (a-z or A-Z).
isPrintable(int byte) → bool
Whether byte is a printable ASCII character (0x20-0x7E).
isWhitespace(int byte) → bool
Whether byte is whitespace (space, tab, newline, etc.).

Constants

arrowDown → const int
Down arrow byte (after ESC [).
arrowLeft → const int
Left arrow byte (after ESC [).
arrowRight → const int
Right arrow byte (after ESC [).
arrowUp → const int
Up arrow byte (after ESC [).
backspace → const Key
Backspace key.
backspaceAlt → const int
Alternative backspace byte (Ctrl+H on some terminals).
backspaceByte → const int
Backspace key byte (DEL on most terminals).
carriageReturn → const int
Carriage return byte / Enter on Windows (Ctrl+M).
ctrlA → const Key
Ctrl+A key.
ctrlAByte → const int
Ctrl+A byte.
ctrlB → const Key
Ctrl+B key.
ctrlBackslash → const int
File separator byte (Ctrl+).
ctrlBByte → const int
Ctrl+B byte.
ctrlBracketRight → const int
Group separator byte (Ctrl+]).
ctrlC → const Key
Ctrl+C key.
ctrlCaret → const int
Record separator byte (Ctrl+^).
ctrlCByte → const int
Ctrl+C byte (interrupt).
ctrlD → const Key
Ctrl+D key.
ctrlDByte → const int
Ctrl+D byte (end of transmission).
ctrlDown → const Key
Ctrl+Down key.
ctrlE → const Key
Ctrl+E key.
ctrlEByte → const int
Ctrl+E byte.
ctrlEnd → const Key
Ctrl+End key.
ctrlF → const Key
Ctrl+F key.
ctrlFByte → const int
Ctrl+F byte.
ctrlG → const Key
Ctrl+G key.
ctrlGByte → const int
Ctrl+G byte (bell).
ctrlH → const Key
Ctrl+H key.
ctrlHByte → const int
Ctrl+H byte (backspace on some terminals).
ctrlHome → const Key
Ctrl+Home key.
ctrlI → const Key
Ctrl+I key.
ctrlJ → const Key
Ctrl+J key.
ctrlK → const Key
Ctrl+K key.
ctrlKByte → const int
Ctrl+K byte.
ctrlL → const Key
Ctrl+L key.
ctrlLByte → const int
Ctrl+L byte (form feed / clear screen).
ctrlLeft → const Key
Ctrl+Left key.
ctrlM → const Key
Ctrl+M key.
ctrlN → const Key
Ctrl+N key.
ctrlNByte → const int
Ctrl+N byte.
ctrlO → const Key
Ctrl+O key.
ctrlOByte → const int
Ctrl+O byte.
ctrlP → const Key
Ctrl+P key.
ctrlPByte → const int
Ctrl+P byte.
ctrlPgDown → const Key
Ctrl+PageDown key.
ctrlPgUp → const Key
Ctrl+PageUp key.
ctrlQ → const Key
Ctrl+Q key.
ctrlQByte → const int
Ctrl+Q byte (XON).
ctrlR → const Key
Ctrl+R key.
ctrlRByte → const int
Ctrl+R byte.
ctrlRight → const Key
Ctrl+Right key.
ctrlS → const Key
Ctrl+S key.
ctrlSByte → const int
Ctrl+S byte (XOFF).
ctrlShiftDown → const Key
Ctrl+Shift+Down key.
ctrlShiftEnd → const Key
Ctrl+Shift+End key.
ctrlShiftHome → const Key
Ctrl+Shift+Home key.
ctrlShiftLeft → const Key
Ctrl+Shift+Left key.
ctrlShiftRight → const Key
Ctrl+Shift+Right key.
ctrlShiftUp → const Key
Ctrl+Shift+Up key.
ctrlT → const Key
Ctrl+T key.
ctrlTByte → const int
Ctrl+T byte.
ctrlU → const Key
Ctrl+U key.
ctrlUByte → const int
Ctrl+U byte.
ctrlUnderscore → const int
Unit separator byte (Ctrl+_).
ctrlUp → const Key
Ctrl+Up key.
ctrlV → const Key
Ctrl+V key.
ctrlVByte → const int
Ctrl+V byte.
ctrlW → const Key
Ctrl+W key.
ctrlWByte → const int
Ctrl+W byte.
ctrlX → const Key
Ctrl+X key.
ctrlXByte → const int
Ctrl+X byte.
ctrlY → const Key
Ctrl+Y key.
ctrlYByte → const int
Ctrl+Y byte.
ctrlZ → const Key
Ctrl+Z key.
ctrlZByte → const int
Ctrl+Z byte (suspend).
delete → const Key
Delete key.
deleteByte → const int
Delete byte (DEL, 0x7F).
down → const Key
Down arrow key.
end → const Key
End key.
enter → const Key
Enter key.
enterByte → const int
Enter key byte (line feed, 0x0A).
enterCR → const int
Enter key byte (carriage return, 0x0D).
escape → const Key
Escape key.
escapeByte → const int
Escape byte (Ctrl+[).
f1 → const Key
F1 key.
f2 → const Key
F2 key.
f3 → const Key
F3 key.
f4 → const Key
F4 key.
f5 → const Key
F5 key.
f6 → const Key
F6 key.
f7 → const Key
F7 key.
f8 → const Key
F8 key.
f9 → const Key
F9 key.
f10 → const Key
F10 key.
f11 → const Key
F11 key.
f12 → const Key
F12 key.
f13 → const Key
F13 key.
f14 → const Key
F14 key.
f15 → const Key
F15 key.
f16 → const Key
F16 key.
f17 → const Key
F17 key.
f18 → const Key
F18 key.
f19 → const Key
F19 key.
f20 → const Key
F20 key.
G → const Key
g → const Key
h → const Key
home → const Key
Home key.
insert → const Key
Insert key.
j → const Key
k → const Key
l → const Key
left → const Key
Left arrow key.
lineFeed → const int
Line feed byte / Enter on Unix (Ctrl+J).
null_ → const int
Null character byte (Ctrl+@).
pageDown → const Key
Page Down key.
pageUp → const Key
Page Up key.
q → const Key
questionMark → const Key
Right arrow key.
shiftDown → const Key
Shift+Down key.
shiftEnd → const Key
Shift+End key.
shiftHome → const Key
Shift+Home key.
shiftLeft → const Key
Shift+Left key.
shiftRight → const Key
Shift+Right key.
shiftTab → const Key
Shift+Tab key.
shiftUp → const Key
Shift+Up key.
slash → const Key
space → const Key
Space key.
spaceByte → const int
Space character byte.
tab → const Key
Tab key.
tabByte → const int
Tab byte (Ctrl+I).
up → const Key
Up arrow key.