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:
- RawKeyDownEvent and RawKeyUpEvent, the classes used to describe specific raw key events.
- RawKeyboardListener, a widget that listens for raw key events.
- SystemChannels.keyEvent, the low-level channel used for receiving events from the system.
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- 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.
read-only
-
physicalKeysPressed
→ Set<
PhysicalKeyboardKey> -
Returns the set of physical keys currently pressed.
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
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.
visibleForTesting">@visibleForTesting
-
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.
inherited
-
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.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → RawKeyboard
-
The shared instance of RawKeyboard.
final