Come up with a coherent scheme for handling a11y
Recently, the keyboard was enriched with the ability to react to system's accessibility policy. That has been previously ignored, with the assumption that the OSK was the only way to enter text, so there was nothing accessible about it: it was a requirement.
As we move into convergence, with external input devices, the OSK loses its privileged status of being required, but it can still function as an accessibility tool.
Some plan should be laid out in terms of how accessibility settings interact with everything else. This might involve the compositor and other pieces of the stack, but I'm going to start it here, since Squeekboard is where the immediate need is.
There are a couple of axes for keyboard-needing:
- Gnome's accessibility "enable on-screen keyboard" setting.
- Having the OSK as the only way to input text, i.e. no physical keyboards present, no other text input methods in use.
- Having a text field that announces input method readiness.
- Shell's OSK visibility override state.
I noticed an ambiguity related to GNOME's "screen-keyboard-enabled" setting: it's under "accessibility", but searching the web doesn't give much connection between helping disabled people and having a virtual keyboard, so that idea sounds better ignored, and the setting treated as a generic override.
Given that the setting is a generic override, it indicates a preference for the on-screen keyboard over physical keyboards, making it troublesome for enabling by default.
There's another problem with this, where the setting is not per-seat, but per-session. Squeekboard, as a bit of a showcase for wayland's input method abilities, should stick to respecting seats as separate humans, to not exclude use cases like https://www.youtube.com/watch?v=6VfpVYYQzHs
Coming to 2., there is currently no support from Wayland to tell the number of non-emulated physical keyboards on the seat.
Otherwise, this sounds like a pretty good candidate for the default policy.
I think the algorithm might go something like:
is-visible = if shell-override-hide then HIDE
if shell-override-show then SHOW
else
(is-sole-keyboard or enable-screen-keyboard) and text-field-exists
For that to work, we need to
- Know the count of other text input devices
- Change how Squeekboard responds to the GNOME setting
- Disable the GNOME setting by default