keyboard constant
A MethodChannel for retrieving keyboard pressed keys from the engine.
The following outgoing methods are defined for this channel (invoked using OptionalMethodChannel.invokeMethod):
-
getKeyboardState
: Obtains keyboard pressed keys from the engine. The keyboard state is sent as aMap<int, int>?
where each entry represents a pressed keyboard key. The entry key is the physical key ID and the entry value is the logical key ID.Both the framework and the engine maintain a state of the current pressed keys. There are edge cases, related to startup and restart, where the framework needs to resynchronize its keyboard state.
See also:
- HardwareKeyboard.syncKeyboardState, which uses this channel to synchronize
the
HardwareKeyboard
pressed state.
Implementation
static const MethodChannel keyboard = OptionalMethodChannel(
'flutter/keyboard',
);