keyboard constant

MethodChannel const keyboard

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 a Map<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:

Implementation

static const MethodChannel keyboard = OptionalMethodChannel(
  'flutter/keyboard',
);