Flutter Engine
The Flutter Engine
|
Classes | |
interface | OnKeyEventHandledCallback |
Public Member Functions | |
void | handleEvent ( @NonNull KeyEvent keyEvent, @NonNull OnKeyEventHandledCallback onKeyEventHandledCallback) |
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 Responder
must call the supplied 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 Responder
fails to call the 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.
Definition at line 145 of file KeyboardManager.java.
void io.flutter.embedding.android.KeyboardManager.Responder.handleEvent | ( | @NonNull KeyEvent | keyEvent, |
@NonNull OnKeyEventHandledCallback | onKeyEventHandledCallback | ||
) |
Informs this Responder
that a new KeyEvent
needs processing.
keyEvent | the new KeyEvent this Responder may be interested in. |
onKeyEventHandledCallback | the method to call when this Responder has decided whether to handle the KeyEvent . |
Implemented in io.flutter.embedding.android.KeyEmbedderResponder, and io.flutter.embedding.android.KeyChannelResponder.