RawKeyboard class Null safety

An interface for listening to raw key events.

Raw key events pass through as much information as possible from the underlying platform's key events, which makes them provide a high level of fidelity but a low level of portability.

A RawKeyboard is useful for listening to raw key events and hardware buttons that are represented as keys. Typically used by games and other apps that use keyboards for purposes other than text entry.

These key events are typically only key events generated by a hardware keyboard, and not those from software keyboards or input method editors.

See also:


hashCode int
The hash code for this object.
keyEventHandler RawKeyEventHandler?
A handler for raw hardware keyboard events that will stop propagation if the handler returns true.
read / write
keysPressed Set<LogicalKeyboardKey>
Returns the set of keys currently pressed.
physicalKeysPressed Set<PhysicalKeyboardKey>
Returns the set of physical keys currently pressed.
runtimeType Type
A representation of the runtime type of the object.


addListener(ValueChanged<RawKeyEvent> listener) → void
Register a listener that is called every time the user presses or releases a hardware keyboard key.
clearKeysPressed() → void
Clears the list of keys returned from keysPressed.
handleRawKeyEvent(RawKeyEvent event) bool
Process a new RawKeyEvent by recording the state changes and dispatching to listeners.
lookUpLayout(PhysicalKeyboardKey physicalKey) LogicalKeyboardKey?
Returns the logical key that corresponds to the given pressed physical key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
removeListener(ValueChanged<RawKeyEvent> listener) → void
Stop calling the given listener every time the user presses or releases a hardware keyboard key.
toString() String
A string representation of this object.


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

Static Properties

instance RawKeyboard
The shared instance of RawKeyboard.