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
Modifier and TypeInterfaceDescriptionstatic interface
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleEvent
(KeyEvent keyEvent, KeyboardManager.Responder.OnKeyEventHandledCallback onKeyEventHandledCallback) Informs thisKeyboardManager.Responder
that a newKeyEvent
needs processing.
-
Method Details
-
handleEvent
void handleEvent(@NonNull KeyEvent keyEvent, @NonNull KeyboardManager.Responder.OnKeyEventHandledCallback onKeyEventHandledCallback) Informs thisKeyboardManager.Responder
that a newKeyEvent
needs processing.- Parameters:
keyEvent
- the newKeyEvent
thisKeyboardManager.Responder
may be interested in.onKeyEventHandledCallback
- the method to call when thisKeyboardManager.Responder
has decided whether to handle theKeyEvent
.
-