KeyboardManager<T extends KeyboardEventData> class
A class that manages keyboard input events and provides signals for when a key is pressed or released.
It tracks the state of the modifier keys (Shift, Control, Alt, and Meta) and provides access to the state of individual keys.
Use the KeyboardManager.onDown and KeyboardManager.onUp signals to subscribe to key press and release events respectively.
Call the KeyboardManager.dispose method to release any resources held by the manager.
Accessible through Stage.keyboard only if the SceneConfig has SceneConfig.useKeyboard set to true.
Constructors
Properties
- focusNode → FocusNode
-
The focus node for keyboard events in the Flutter Widget tree.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAltPressed → bool
-
Returns whether the alt key is currently pressed.
no setter
- isControlPressed → bool
-
Returns whether the control key is currently pressed.
no setter
- isMetaPressed → bool
-
Returns whether the meta key is currently pressed.
On macos, this is the command key.
On windows, this is the windows key.
no setter
- isShiftPressed → bool
-
Returns whether the shift key is currently pressed.
no setter
-
onDown
→ EventSignal<
T> -
The onDown event signal is dispatched when a keystroke is pressed.
no setter
-
onUp
→ EventSignal<
T> -
The onUp event signal is dispatched when a keystroke is released.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
$process(
KeyboardEventData event) → void -
(Internal usage)
Processes the given
event
. -
dispose(
) → void - Removes all event listeners.
-
isPressed(
GKey key) → bool -
Returns whether the given
key
is currently pressed. -
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