Monday, 4 March 2019

usb - Trouble assigning different layouts to multiple simultaneous input devices in Linux

I have a Linux machine on which I frequently switch between a standard, wireless Logitech keyboard with built-in trackpad, and an "air mouse" with built-in mini keyboard. The keyboard has a Swedish layout and the air mouse has a US layout, and I would prefer not having to change the global layout in X every time I switch.


I have searched extensively and found several similar discussions, all involving setxkbmap -device -layout as a solution, but no matter how I try that command always changes the layout of both devices.


I'm thinking this might have something to do with the fact that, for some reason, both devices are listed as 'pointer' in xinput -list. Here, device 9 is the Logitech keyboard, and device 11 is the keyboard part of the air mouse.


⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech Unifying Device. Wireless PID:4032 id=9 [slave pointer (2)]
⎜ ↳ Usb Compliant device Usb Compliant device id=10 [slave pointer (2)]
⎜ ↳ Usb Compliant device Usb Compliant device id=11 [slave pointer (2)]
⎜ ↳ MCE IR Keyboard/Mouse (nuvoton-cir) id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Nuvoton w836x7hg Infrared Remote Transceiver id=12 [slave keyboard (3)]

Maybe setting the layout of a pointer device is not allowed and thus my attempts to do so default to setting the master layout instead? I don't know.


I did try reattaching my devices to the master keyboard instead, with xinput reattach 11 3, but that just gives me this error message:


X Error of failed request:  XI_BadDevice (invalid Device parameter)
Major opcode of failed request: 131 (XInputExtension)
Minor opcode of failed request: 43 ()
Device id in failed request: 0x17
Serial number of failed request: 18
Current serial number in output stream: 19

At this point I'm all out of ideas, and feel like I've exhausted all internet resources, so any ideas, anyone?

No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...