Package io.flutter.embedding.android
Interface KeyboardManager.Responder
- All Known Implementing Classes:
KeyChannelResponder,KeyEmbedderResponder
- Enclosing class:
- KeyboardManager
public static interface KeyboardManager.Responder
The interface for responding to a
KeyEvent asynchronously.
Implementers of this interface should be owned by a KeyboardManager, in order to
receive key events.
After receiving a KeyEvent, the KeyboardManager.Responder must call the supplied KeyboardManager.Responder.OnKeyEventHandledCallback exactly once, to inform the KeyboardManager whether it
wishes to handle the KeyEvent. The KeyEvent will not be propagated to the
TextInputPlugin or be redispatched to the view hierachy if any key responders answered
yes.
If a KeyboardManager.Responder fails to call the KeyboardManager.Responder.OnKeyEventHandledCallback callback, the
KeyEvent will never be sent to the TextInputPlugin, and the KeyboardManager class can't detect such errors as there is no timeout.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleEvent(KeyEvent keyEvent, KeyboardManager.Responder.OnKeyEventHandledCallback onKeyEventHandledCallback) Informs thisKeyboardManager.Responderthat a newKeyEventneeds processing.
-
Method Details
-
handleEvent
void handleEvent(@NonNull KeyEvent keyEvent, @NonNull KeyboardManager.Responder.OnKeyEventHandledCallback onKeyEventHandledCallback) Informs thisKeyboardManager.Responderthat a newKeyEventneeds processing.- Parameters:
keyEvent- the newKeyEventthisKeyboardManager.Respondermay be interested in.onKeyEventHandledCallback- the method to call when thisKeyboardManager.Responderhas decided whether to handle theKeyEvent.
-