[text] Always forward hard key events to clients
This change implement's Viktar's idea to forward key events to legacy input method editor clients, even if a new TextField-style input method is connected. Previously, if a new TextField-style input method was connected, key events sent to ImeService would only be forwarded to that. Now, key events are forwarded twice in these cases — once to the input method, so it can determine any state changes, and once as a `forward_event` call to any legacy ImeClients, so they can still get legacy key press information that is not provided by the new TextField interface. This change also makes inject_input on an Ime never send keystrokes through DidUpdateState. This means instead of a single DidUpdateState(new_state, key_event) call, legacy text fields will get an initial DidUpdateState(old_state, key_event) call followed by a DidUpdateState(new_state, None) call. Change-Id: I557b7884618690f25e883e73ee2ad4c356a7fdd3
Showing
- garnet/bin/ui/ime/src/fidl_helpers.rs 11 additions, 0 deletionsgarnet/bin/ui/ime/src/fidl_helpers.rs
- garnet/bin/ui/ime/src/ime_service.rs 86 additions, 27 deletionsgarnet/bin/ui/ime/src/ime_service.rs
- garnet/bin/ui/ime/src/legacy_ime/handler.rs 19 additions, 14 deletionsgarnet/bin/ui/ime/src/legacy_ime/handler.rs
- garnet/bin/ui/ime/src/legacy_ime/state.rs 13 additions, 19 deletionsgarnet/bin/ui/ime/src/legacy_ime/state.rs
- garnet/bin/ui/ime/src/legacy_ime/tests.rs 4 additions, 4 deletionsgarnet/bin/ui/ime/src/legacy_ime/tests.rs
Loading
Please register or sign in to comment