Package io.flutter.embedding.android
Class KeyEmbedderResponder
java.lang.Object
io.flutter.embedding.android.KeyEmbedderResponder
- All Implemented Interfaces:
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
-
Method Summary
Modifier and TypeMethodDescriptionReturns 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.
-
Constructor Details
-
KeyEmbedderResponder
-
-
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 interfaceKeyboardManager.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
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.
-