Bug 98194

Summary: [wishlist] API to use keyboard-specific XkbOptions
Product: Wayland Reporter: Vasilij Schneidermann <mail>
Component: libinputAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: medium CC: peter.hutterer
Version: 1.5.0   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Vasilij Schneidermann 2016-10-10 14:50:20 UTC
I am using a laptop with its internal keyboard and an external keyboard when not on the go.  Both keyboards have different layouts, therefore I've figured out two different sets of XkbOptions to make the most of this situation with Xorg [1].

However there doesn't seem to be a way to make this kind of setup work with wayland compositors based on libinput.  I've spoken to the respective authors and it appears that the only way of changing keyboard configuration is by setting environment variables like `XKBOPTIONS`.  The libinput API doesn't seem to cover programmatic access and modification of keyboards either, only pointer devices.  Please let me know if I'm wrong about this, otherwise consider this an enhancement request.

[1]: https://github.com/wasamasa/dotfiles/blob/master/etc/X11/xorg.conf.d/20-keyboards.conf
Comment 1 Pekka Paalanen 2016-10-10 16:16:14 UTC
Hi,

the library you are looking for to programmatically configure is xkbcommon, http://xkbcommon.org/ .

Each compositor has it's own way of configuring things. If you really need two completely separate keyboard configurations, it might be necessary to assign the keyboard devices to two different 'wl_seat' objects. That way they become independent.
Comment 2 Peter Hutterer 2016-10-11 08:50:19 UTC
see Pekka's answer, libinput sits below xkb and merely forwards the keycodes, independent of any layout that may be applied later. The layout configuration is the task of the compositor, not something we do/can/want to control from within libinput

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.