Bug 95355 - Cannot set layouts for individual keyboards
Summary: Cannot set layouts for individual keyboards
Status: RESOLVED WONTFIX
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-11 19:20 UTC by Bruce-Robert Fenn Pocock
Modified: 2016-05-11 21:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Bruce-Robert Fenn Pocock 2016-05-11 19:20:19 UTC
XWayland presents a (partial) implementation of the XKB interface to set up keyboard mappings. Unfortunately, in what I consider a regression, there does not appear to be a mechanism to set the key mappings/layouts for individual (hardware) keyboard devices.


(apologies if this is on the wrong component)


In a typical, single-keyboard system, this seems to work all right, but:

Imagine a computer with two physical keyboards connected, in which no single key map will be useful/correct with both.

Examples include:
 1. QWERTY built-in laptop keyboard with Dvorak USB external keyboard that is usually present
 2. Alternate language (alphabet) keyboards, eg, Greek and US/English, connected at the same time, who may differ not only in letters but also bucky keys (eg, AltGr, Compose, Alt/Meta)
 3. Laptop whose Num Lock function uses an overlay on the main keyboard area, but used with an external keypad. Without separate key maps, enabling Num Lock causes the main keyboard to be unusable.

I realise the default (eg, Gnome) settings programs all assume that they “should” merely set the keymap for core input, but in these 3 cases (at least) that behaviour is incorrect.

Particularly, relocating bucky (modifier) keys is annoying/troublesome and makes switching between layouts constantly quite difficult.

Using “setxkbmap -device $DEVICE $KEYMAP” one can work around these problems, which I routinely do. However, in Fedora 23 / Gnome 3 / Wayland, the individual/constituent keyboards do not appear to be configurable in any way.

My instinct is to ask that the constituent keyboard devices be enumerated as they are (correctly, IMHO) in X.org's native form. Presenting some alternative mechanism would be acceptable as well, of course.

The current situation is, to me at least, a regression, and a blocker from using Wayland on any of my “daily driver” workstations. This is mostly because I use a custom multi-language Dvorak layout but somewhat frequently “pair” with others who prefer (require) US/Qwerty.
Comment 1 Daniel Stone 2016-05-11 21:38:36 UTC
Having discrete keymaps for separate-but-paired devices (those sharing a master keyboard under X, or sharing a wl_seat under Wayland) seemed like a good idea at the time I implemented it, but doesn't actually work well in practice. In particular, handling keymaps with disjoint modifier maps fails spectacularly.

Given that, for Wayland I decided to keep one keymap at the root event-aggregation unit, i.e. wl_seat+wl_keyboard under Wayland / all keyboards connected to one master keyboard under X11.

If you need disjoint keymaps, you will have to move them to be under different seats: there is no other way it can actually end up working properly in practice.

Sorry to disappoint, but even after 10 years there are still some pretty bad bugs remaining in the X11 implementation, and not all of them are fixable.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.