xkb set via xkbcomp does not seem to apply to -i <device> (or does not stick if used on general device)
Submitted by ngo..@..il.com
Assigned to Xorg Project Team
Description
I have a Lenovo N700, which appears as both a mouse and keyboard (connected via bluetooth or wireless, all details here are while its connected as bluetooth). Currently it has id 14 as seen below.
⎜ ↳ Lenovo Mice N700 id=14 [slave pointer (2)]
Reporting 8 classes:
Class originated from: 14. Type: XIButtonClass
Buttons supported: 13
Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" "Button Side" "Button Extra" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown"
Button state:
Class originated from: 14. Type: XIKeyClass
Keycodes supported: 248
I wanted to remap one of the letters (the letter c) to some other key (in testing, I just use 'q'). The reason being a side-swipe on the touch-sensitive pad on this mouse would produce c-down, Super-down, c-up, Super-up (I have evemu-record output if that would be useful). Which would basically type the letter c wherever my cursor happened to be, which is annoying (for example in gmail's web interface I'd get a compose window).
When I get the current keyboard map using xkbcomp -i 14 :0 map.xkb
, I can edit it to change the output. I then try to apply this output using xkbcomp -i 14 synch map.xkb :0
This does not change what the key does on my mouse, even though re-running xkbcomp -i 14 :0 map.xkb
shows the change did 'take'. So I tried various inputs out of the below:-
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ETPS/2 Elantech Touchpad id=13 [slave pointer (2)]
⎜ ↳ Lenovo Mice N700 id=14 [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)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ ASUS USB2.0 Webcam id=10 [slave keyboard (3)]
↳ Asus WMI hotkeys id=11 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=12 [slave keyboard (3)]
A summary of what I've found:
- Using input 14 does not change anything
- Using input 12 has two different results:
- If I start typing c on my keyboard the letter c comes out. However if I side-swipe on my mouse, the letter c comes out, if I then switch back to keyboard, thereafter the letter q comes out if I use mouse or keyboard
- If I start by sideswiping with my mouse the letter q comes out, then the letter q will always come out whether using mouse or keyboard
- My conclusion from using input 12 is that using the mouse somehow 'activates' the xkb change for both mouse and keyboard
- Using input 5 does not change anything
- Using input 3 has two different results:
- If I start typing c on my keyboard, the letter q comes out. Side-swiping then gives q, but switching back to the keyboard gives c from then on
- If I start sideswiping on my mouse, the letter c comes out, and the same from the keyboard thereafter
My summary so far has been that the usage of this mouse somehow resets input 3 and/or 12. This may have something to do with udev etc., I am not familiar enough to know. I'm pretty sure I've found a bug, but have no idea what the bug actually is.
For reference, I'm running Arch Linux 64-bit, so pretty much the latest release of everything.