Package io.flutter.embedding.android

# Class KeyEmbedderResponder

java.lang.Object
io.flutter.embedding.android.KeyEmbedderResponder

All Implemented Interfaces:
  `KeyboardManager.Responder`

public class KeyEmbedderResponder extends Object implements KeyboardManager.Responder
A `KeyboardManager.Responder` of `KeyboardManager` that handles events by sending processed information in `KeyData`.

This class corresponds to the HardwareKeyboard API in the framework.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface io.flutter.embedding.android.KeyboardManager.Responder

  `KeyboardManager.Responder.OnKeyEventHandledCallback`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `KeyEmbedderResponder(BinaryMessenger messenger)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Map<Long,Long>`
  `getPressedState()`
  Returns an unmodifiable view of the pressed state.
  `void`
  `handleEvent(KeyEvent event, KeyboardManager.Responder.OnKeyEventHandledCallback onKeyEventHandledCallback)`
  Parses an Android key event, performs synchronization, and dispatches Flutter events through the messenger to the framework with the given callback.

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

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

- ## Constructor Details

  - ### KeyEmbedderResponder

    public KeyEmbedderResponder(BinaryMessenger messenger)

- ## Method Details

  - ### handleEvent

    public void handleEvent(@NonNull KeyEvent event, @NonNull KeyboardManager.Responder.OnKeyEventHandledCallback onKeyEventHandledCallback)
    Parses an Android key event, performs synchronization, and dispatches Flutter events through the messenger to the framework with the given callback.

    At least one event will be dispatched. If there are no others, an empty event with 0 physical key and 0 logical key will be synthesized.

    Specified by:
      `handleEvent` in interface `KeyboardManager.Responder`
    Parameters:
      `event` - The Android key event to be handled.
      `onKeyEventHandledCallback` - the method to call when the framework has decided whether to handle this event. This callback will always be called once and only once. If there are no non-synthesized out of this event, this callback will be called during this method with true.

  - ### getPressedState

    public Map<Long,Long> getPressedState()
    Returns an unmodifiable view of the pressed state.
    Returns:
      A map whose keys are physical keyboard key IDs and values are the corresponding logical keyboard key IDs.