Keyboard AltGr bug

37 views
Skip to first unread message

Kelly Dean

unread,
Jul 31, 2017, 8:16:15 AM7/31/17
to qubes...@googlegroups.com
In Qubes 3.2 with i3, in any qube, regardless of which template I use, and regardless of which physical keyboard I use, the right Alt key is useless when mapped as AltGr, because it generates spurious Alt_L events.

With a standard American keyboard (or Polish one; they're equivalent except for the markings) and American localization, start a new qube, run xev, press and release right Alt, and notice you get KeyPress and KeyRelease events for keycode 108 (keysym Alt_R).

Now, do this:
xmodmap -e 'remove mod1 = Alt_R'
xmodmap -e 'keycode 108 = Mode_switch'

Then run xev again, and notice when you press right Alt, you get a KeyPress event for keycode 108 (keysym Mode_switch), as expected. However, when you release right Alt, you get two events: a spurious KeyPress event for keycode 64 (keysym Alt_L), followed by a KeyRelease event for keycode 108 (keysym Mode_switch). You should only get the latter.

Why does that happen?

On another system running plain Debian instead of Qubes, using the same keyboards, I don't get the spurious KeyPress for keycode 64.

Ángel

unread,
Aug 15, 2017, 6:58:58 PM8/15/17
to qubes...@googlegroups.com, Kelly Dean
On 2017-07-31 at 12:15 +0000, Kelly Dean wrote:
> In Qubes 3.2 with i3, in any qube, regardless of which template I use, and regardless of which physical keyboard I use, the right Alt key is useless when mapped as AltGr, because it generates spurious Alt_L events.
>
> With a standard American keyboard (or Polish one; they're equivalent except for the markings) and American localization, start a new qube, run xev, press and release right Alt, and notice you get KeyPress and KeyRelease events for keycode 108 (keysym Alt_R).
>
> Now, do this:
> xmodmap -e 'remove mod1 = Alt_R'
> xmodmap -e 'keycode 108 = Mode_switch'
>
> Then run xev again, and notice when you press right Alt, you get a KeyPress event for keycode 108 (keysym Mode_switch), as expected. However, when you release right Alt, you get two events: a spurious KeyPress event for keycode 64 (keysym Alt_L), followed by a KeyRelease event for keycode 108 (keysym Mode_switch). You should only get the latter.
>
> Why does that happen?

Hello Kelly

I have found that when changing the modifiers, I need to run the xmodmap
on dom0 *and* the inner qube.

I don't really know why that's the case, I would expect it would only
need to be changed on one of the two xorg servers involved, but that's
what worked for me. I haven't found any documentation about how the key
presses are passed between domains, but the issue seem to lie there.

Hope that helps

Reply all
Reply to author
Forward
0 new messages