RFC: Making it possible to use text-input without keyboard events
When designing the text-input protocol, the initial use case was to use it as a mirror of what virtual keyboards on Android do, but also to make it possible to use as a standalone assistive technology.
Currently, the text-input protocol cannot even in the best case be used without a keyboard or mouse for common things that other OS can do. Android keyboards have the "submit" button, which can receive some hints from the application. Text-input compositors must emulate that with a "return" keycode, dropping some of its semantics: "submit" is not the same as "move to the next line", but "return" can mean either.
Another common action is "undo"/"redo", which is usually supported in text fields, but not indicated in any way by applications. The key presses to emulate it will change meaning between applications, making it hard to emulate.
Extending this to accessibility technologies, there is an overlap with the general idea of "shortcuts", which could encompass things like "next/previous field", "next word", etc. Mac OS uses such a system for all shortcuts: https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding
While I'm not sure whether such a scale is needed, something to the same effect could solve some problems:
- using keyboard emulation just for submitting is an overkill, especially for input-method protocol clients which would have to support something like virtual-keyboard, which has some problems that are irrelevant to this case
- the interface could ask clients if relevant features are allowed (undo is not universal, submit isn't always valid)
While this could be a standalone protocol, it would have to add new enter/leave events, or attach to the existing ones, so I would suggest this to become part of a larger text-input protocol update, starting with basic actions only.
Does this make sense as a protocol, or should text-input compositors rather stick to keyboards explicitly?