keyEvent constant Null safety
A JSON BasicMessageChannel for keyboard events.
Each incoming message received on this channel (registered using
BasicMessageChannel.setMessageHandler) consists of a Map with
platform-specific data, plus a type
field which is either keydown
, or
keyup
.
On Android, the available fields are those described by RawKeyEventDataAndroid's properties.
On Fuchsia, the available fields are those described by RawKeyEventDataFuchsia's properties.
No messages are sent on other platforms currently.
See also:
- RawKeyboard, which uses this channel to expose key data.
- RawKeyEvent.fromMessage, which can decode this data into the RawKeyEvent subclasses mentioned above.
Implementation
static const BasicMessageChannel<Object?> keyEvent = BasicMessageChannel<Object?>(
'flutter/keyevent',
JSONMessageCodec(),
);