io.flutter.embedding.engine.systemchannels

## Class KeyEventChannel

- java.lang.Object
- - io.flutter.embedding.engine.systemchannels.KeyEventChannel

-     public class KeyEventChannel
      extends Object

  Event message channel for key events to/from the Flutter framework.

  Sends key up/down events to the framework, and receives asynchronous messages from the framework about whether or not the key was handled.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `KeyEventChannel.EventResponseHandler` A handler of incoming key handling messages.
    `static class` | `KeyEventChannel.FlutterKeyEvent` A key event as defined by Flutter.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `BasicMessageChannel<Object>` | `channel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KeyEventChannel(BinaryMessenger binaryMessenger)` A constructor that creates a KeyEventChannel with the default message handler.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `keyDown(KeyEventChannel.FlutterKeyEvent keyEvent)`
    `void` | `keyUp(KeyEventChannel.FlutterKeyEvent keyEvent)`
    `void` | `setEventResponseHandler(KeyEventChannel.EventResponseHandler handler)` Sets the event response handler to be used to receive key event response messages from the framework on this channel.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### channel

          @NonNull
          public final BasicMessageChannel<Object> channel

  - ### Constructor Detail

    - #### KeyEventChannel

          public KeyEventChannel(@NonNull
                                 BinaryMessenger binaryMessenger)

      A constructor that creates a KeyEventChannel with the default message handler.
      Parameters:
        `binaryMessenger` - the binary messenger used to send messages on this channel.

  - ### Method Detail

    - #### setEventResponseHandler

          public void setEventResponseHandler(KeyEventChannel.EventResponseHandler handler)

      Sets the event response handler to be used to receive key event response messages from the framework on this channel.

    - #### keyUp

          public void keyUp(@NonNull
                            KeyEventChannel.FlutterKeyEvent keyEvent)

    - #### keyDown

          public void keyDown(@NonNull
                              KeyEventChannel.FlutterKeyEvent keyEvent)