Skip to content

backends/x11: Fix key repeat of on-screen keyboard for second level keysyms

Ray Strode requested to merge fix-key-repeat into main

Certains keys (such as ~ and |) are in the keyboard map behind the second shift level. This means in order for them to be input, the shift key needs to be held down by the user.

The GNOME Shell on-screen keyboard presents these keys separately on a page of keys that has no shift key. Instead, it relies on mutter to set a shift latch before the key event is emitted. A shift latch is a virtual press of the shift key that automatically gets released after the next key press (in our case the ~ or | key).

The problem is using a shift latch doesn't work very well in the face of key repeat. The latch is automatically released after the first press, and subsequent repeats of that press no longer have shift latched to them.

This commit fixes the problem by using a shift lock instead of a shift latch. A shift lock is never implicitly released, so it remains in place for the duration of key repeat.

Closes #1963 (closed)

Edited by Ray Strode

Merge request reports