KeyEventManager class Null safety
A singleton class that processes key messages from the platform and dispatches converted messages accordingly.
KeyEventManager receives platform key messages by handleKeyData and handleRawKeyMessage, sends converted events to HardwareKeyboard and RawKeyboard for recording keeping, and then dispatches the KeyMessage to keyMessageHandler, the global message handler.
KeyEventManager also resolves cross-platform compatibility of keyboard implementations. Legacy platforms might have not implemented the new key data API and only send raw key data on each key message. KeyEventManager recognize platform types as KeyDataTransitMode and dispatches events in different ways accordingly.
KeyEventManager is typically created, owned, and invoked by ServicesBinding.
- KeyEventManager(HardwareKeyboard _hardwareKeyboard, RawKeyboard _rawKeyboard)
- Create an instance.
- hashCode → int
The hash code for this object.
- keyMessageHandler ↔ KeyMessageHandler?
The global entrance which handles all key events sent to Flutter.
read / write
- runtimeType → Type
A representation of the runtime type of the object.
) → void
- Reset the inferred platform transit mode and related states.
KeyData data) → bool
- Dispatch a key data to global and leaf listeners.
dynamic message) → Future< Map< String, dynamic>>
- Handles a raw key message.
Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
) → String
A string representation of this object.
Object other) → bool
The equality operator.