keyEvent constant
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.
- new RawKeyEvent.fromMessage, which can decode this data into the RawKeyEvent subclasses mentioned above.
Implementation
static const BasicMessageChannel<dynamic> keyEvent = BasicMessageChannel<dynamic>(
'flutter/keyevent',
JSONMessageCodec(),
)