Flutter Engine
The Flutter Engine
|
Classes | |
class | CharacterCombiner |
interface | Responder |
interface | ViewDelegate |
Public Member Functions | |
KeyboardManager (@NonNull ViewDelegate viewDelegate) | |
boolean | handleEvent (@NonNull KeyEvent keyEvent) |
void | destroy () |
Map< Long, Long > | getKeyboardState () |
boolean | handleEvent (@NonNull KeyEvent keyEvent) |
Map< Long, Long > | getKeyboardState () |
Protected Attributes | |
final Responder[] | responders |
Processes keyboard events and cooperate with TextInputPlugin
.
Flutter uses asynchronous event handling to avoid blocking the UI thread, but Android requires that events are handled synchronously. So when the Android system sends newlink KeyEvent} to Flutter, Flutter responds synchronously that the key has been handled so that it won't propagate to other components. It then uses "delayed event synthesis", where it sends the event to the framework, and if the framework responds that it has not handled the event, then this class synthesizes a new event to send to Android, without handling it this time.
Flutter processes an Android KeyEvent
with several components, each can choose whether to handled the event, and only unhandled events can move to the next section.
KeyboardManager.Responder
s simultaneously. After all responders have responded (asynchronously), the event is considered handled if any responders decide to handle. TextInputPlugin
, processed synchronously with a result of whether it is handled. TextInputPlugin
, or the text field does not handle the KeyEvent
either, the KeyEvent
will be sent back to the top of the activity's view hierachy, allowing it to be "redispatched". The KeyboardManager
will remember this event and skip the identical event at the next encounter. Definition at line 45 of file KeyboardManager.java.
|
inline |
Construct a KeyboardManager
.
viewDelegate | provides a set of interfaces that the keyboard manager needs to interact with other components and the platform, and is typically implements by FlutterView . |
Definition at line 118 of file KeyboardManager.java.
|
inline |
Definition at line 238 of file KeyboardManager.java.
|
inline |
Returns an unmodifiable view of the pressed state.
Implements io.flutter.embedding.engine.systemchannels.KeyboardChannel.KeyboardMethodHandler.
Definition at line 267 of file KeyboardManager.java.
|
inline |
Implements io.flutter.plugin.editing.InputConnectionAdaptor.KeyboardDelegate.
Definition at line 220 of file KeyboardManager.java.
|
protected |
Definition at line 215 of file KeyboardManager.java.