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 aKeyEvent
asynchronously.Implementers of this interface should be owned by a
KeyboardManager
, in order to receive key events.After receiving a
KeyEvent
, theKeyboardManager.Responder
must call the suppliedKeyboardManager.Responder.OnKeyEventHandledCallback
exactly once, to inform theKeyboardManager
whether it wishes to handle theKeyEvent
. TheKeyEvent
will not be propagated to theTextInputPlugin
or be redispatched to the view hierachy if any key responders answered yes.If a
KeyboardManager.Responder
fails to call theKeyboardManager.Responder.OnKeyEventHandledCallback
callback, theKeyEvent
will never be sent to theTextInputPlugin
, and theKeyboardManager
class can't detect such errors as there is no timeout.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
KeyboardManager.Responder.OnKeyEventHandledCallback
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
handleEvent(KeyEvent keyEvent, KeyboardManager.Responder.OnKeyEventHandledCallback onKeyEventHandledCallback)
Informs thisKeyboardManager.Responder
that a newKeyEvent
needs processing.
-
-
-
Method Detail
-
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
.
-
-