Virtual keyboard changes system keyboard layout under sway - why?

Justus-dev at Piater.name Justus-dev at Piater.name
Mon Apr 6 12:36:03 UTC 2020


Hello,

In my quest for an on-screen keyboard (OSK) for sway, the closest I've
found are Purism's squeekboard and virtboard.  They both use the Wayland
virtual keyboard protocol.  Surprisingly (to me), they affect my
installed keyboard layout:

1. They install a session-wide keyboard layout and leave it behind, at
   least if terminated improperly.

2. Afterwards, I cannot reset my keyboard layout using 'swaymsg input
   ... xkb_layout de'; it silently runs without taking effect.
   Running 'swaymsg reload' does restore it though.

The second phenomenon is surely a defect? In sway, wlroots, or
{virt|squeek}board? Or is it just that I am trying to abuse Purism's
OSKs outside their purpose of serving as the only keyboard present on a
system?

How about the first point? In my naive world view, the OSK should use
any layout I tell it to use, but it should leave intact the layout of
any other keyboard I happen to have on my system.  I can attach an
external keyboard with en_US layout to my laptop with de layout.  Why
can't I additionally run a French azerty OSK? And yet another Greek
OSK at the same time?

I clearly lack understanding of how Wayland input protocols work, and
hope someone over here will enlighten me.  In particular, is the
behavior I describe above intentional or accidental?

My motivation is that I am trying to understand what it minimally takes
to inject characters into applications under Wayland (specifically
sway).  For example, for my touchscreen I would like to have an OSK and
dasher [1].  For my scripted password manager, formerly based on
xdotool, I wrote uinputchars [2], which works perfectly for me but is
only a crutch until I have a proper Wayland solution.

Thanks,
Justus


[1] https://github.com/dasher-project/dasher
[2] https://github.com/piater/uinputchars


More information about the wayland-devel mailing list