Fix for external keyboard
This pull request introduces the groundwork for controlling the keyboard using an external input device, such as a TV remote. With these changes, the keyboard can now be navigated and interacted with through external control, improving accessibility and enabling new use cases beyond touch input.
Key points:
-
Implemented logic in the keyboard core to support navigation and key selection via external devices.
-
Changes improve integration with TV boxes, game consoles, or other remote-controlled environments.
-
[ ] Navigating word suggestions and the emoji keyboard is not yet functional.
Modifications in EmojiPalettesAdapter and EmojiPalettesView are experimental and do not affect the normal operation of the keyboard.
This PR lays the foundation for full external control support while keeping standard touch-based functionality fully intact.
Thanks!
Some not really ordered thoughts
- This breaks functionality for normal keyboards (for the used key codes). Ideally we would detect whether the sending device is a remote (there is an
InputDevicein the event), or if this doesn't work it should be a setting. - The key event handling should be done in the listener, not in LatinIME, so everything is in the same place
- There are unrelated changes that should not be in this PR, like removing / shortening documentation, addition of empty lines, spacing adjustments, ...
- Being unable to move to suggestions: you obviously need to change the view, so
KeyboardView.moveFocusshould return whether the change was suggessful. This is also relevant for emojis, because the emoji keyboard actually is a bunch of 3 line keyboard views (not sure why this was done) - There are also UP_LEFT and similar key codes that might be used be e.g. game controllers
- Popups can't be opened, but when opening popups with touch they can be controlled, sort of