KeyEvent class
An immutable decoded key press.
Constructors
- KeyEvent(KeyType type, {int? rune, String? ctrl, int? x, int? y})
-
const
- KeyEvent.char(int rune)
-
A printable-character event for
rune.factory - KeyEvent.click({required int x, required int y})
-
A left click with the pointer at the 0-based cell (
x,y).factory - KeyEvent.ctrl(String letter)
-
A
Ctrl-letter event forletter(lowercase).factory - KeyEvent.wheel({required bool up, required int x, required int y})
-
A wheel step (KeyType.wheelUp when
up, else KeyType.wheelDown) with the pointer at the 0-based cell (x,y).factory
Properties
- ctrl → String?
-
The lowercase letter for a KeyType.ctrlChar event (e.g.
's'forCtrl-S), elsenull.final - hashCode → int
-
The hash code for this object.
no setteroverride
- isMouse → bool
-
Whether this came from the mouse (a wheel step or a click) rather than
the keyboard.
no setter
- isWheel → bool
-
Whether this is a mouse-wheel step (KeyType.wheelUp/KeyType.wheelDown).
no setter
- rune → int?
-
The Unicode code point for a KeyType.char event, else
null.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String
-
The character for a KeyType.char event (empty otherwise).
no setter
- type → KeyType
-
final
- x → int?
-
The pointer's 0-based column for a wheel event, else
null.final - y → int?
-
The pointer's 0-based row for a wheel event, else
null.final
Methods
-
isCtrl(
String letter) → bool -
Whether this is
Ctrl-[letter]. -
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.
override