The NoSymbol and XF86Fn keysyms are already filtered out because they
are not available and because the function key is a keysym modifier.
Remove the sanitizing.
When one modifier key is released, only the same key is drawn, even if
there are other identical modifier keys. Be consistent with this
optimization, and only draw the exact key that was pressed when a
modifier key is pressed.
Most future modifier keys will be accents that wouldn't be represented
with an actual key press. Only emit modifier keys as key presses if they
are of the other type (Ctrl, Alt, Shift).
Keys are unsupported if they have no name, or if xkeysym uses a
different format for their name (e.g. XF86Fn). Skip key symbols that
have no name and can't be added to the text keymap.
To support this, set the availability of each keysym before updating the
keymap.
The SXMO (sway) environment expects that the on-screen keyboard does not
handle visibility by itself. Add a new target that ignores the program's
own show/hide requests and shows the keyboard on startup.
If the key value can emit text, it should put the text to be emitted in
the text field. It should not put any special symbol for the key label,
and it should instead be a special case in the display_label() method.
On Phosh, the EWOULDBLOCK error may be emitted when reading from the
Wayland socket, which is not fatal. Ignore errors encountered while
reading, as fatal errors would be emitted by other operations in the
main loop.
Some keys may have no XKB key symbol, but still have the ability to emit
text. Examples include the "‹" (U+2039) and "›" (U+203A) characters. Add
the text property to key parts so they can emit text even with no key
symbol.
Also, for keys that were not modified by the Function key because they
had no XKB key symbol name, modify them.
It should be possible to build both Wayland (sans D-Bus) and GNOME
versions simultaneously. Add a Wayland target, and, for consistency,
rename the GNOME target.
D-Bus support is large, and should have an option to be excluded. Move
the struct implementing D-Bus support from the dispatcher to the main
file, so it can be replaced with a stub.
The D-Bus interfaces used by Phosh are org.gnome.SessionManager for
recovering critical services from crashes and sm.puri.OSK0 for manual
on-screen keyboard activation. Add support for them.
While the keyboard is running, it may want to automatically show or hide
itself depending on whether a text input is active. Add functions to
show and hide the surface by destroying and re-creating it.
Phosh's compositor, phoc, does not emit configure events in reaction to
a surface being committed with no buffer attached. The complicated
surface creation/destruction process is for compatibility with phoc.
The Held state is for modifier that should be off when the corresponding
key is released. If the user presses the modifier key and a normal key,
it would be in this state. The modifier would continue to be active when
the user moves to a different key part (a cancel, e.g. from Fn to Alt)
afterwards. To fix this, add the HeldPressed and HeldLockedPressed
states that reset to the Released state when cancelled.