A widget that calls a callback whenever the user presses or releases a key on a keyboard.
A RawKeyboardListener 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.
For text entry, consider using a RawInput, which integrates with on-screen keyboards and input method editors (IMEs).
See also:
- RawInput, which should be used instead of this widget for text entry.
- Inheritance
- Object
- Widget
- StatefulWidget
- RawKeyboardListener
Constructors
- RawKeyboardListener({Key key, bool focused: false, ValueChanged<RawKeyEvent> onKey, Widget child })
-
Creates a widget that receives raw keyboard events.
Properties
- child → Widget
-
The widget below this widget in the tree.
read-only - focused → bool
-
Whether this widget should actually listen for raw keyboard events.
read-only - onKey → ValueChanged<RawKeyEvent>
-
Called whenever this widget receives a raw keyboard event.
read-only - hashCode → int
-
Get a hash code for this object.
read-only, inherited - key → Key
-
Controls how one widget replaces another widget in the tree.
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
createState(
) → _RawKeyboardListenerState -
Creates the mutable state for this widget at a given location in the tree.
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited -
debugFillDescription(
List<String> description) → void -
Add additional information to the given description for use by toString.
inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited -
toStringShort(
) → String -
A short, textual description of this widget.
inherited