[SOLVED] Zoom key/slider Microsoft Ergonomic Keyboard 4000

Getting your soundcard to work, using Debian on non-i386 hardware, etc

[SOLVED] Zoom key/slider Microsoft Ergonomic Keyboard 4000

Postby qazwsxedc » 2019-02-08 11:52

On a new Debian Stretch with MATE desktop installation I have a problem with the zoom slider. It is no longer being recognized as a key / keys.

dmesg shows the keyboard being recognized correctly at boot time. It is also correctly set up in MATE desktop - Preferences - Hardware - Keyboard. I'm using it to type this ;-)

Using xev I get key events for all the keys on the keyboard except for the zoom slider.
Using showkey, ditto. All fine except zoom slider.

To be clear, this is not about remapping the zoom slider, it is about the zoom slider not being recognized as key presses at all. (I want to remap it eventually, but I can't remap what isn't being recognized as a keypress...)

If I plug the keyboard into an old Wheezy machine, the zoom slider is recognized correctly, so it's not a hardware problem. Between Wheezy and Stretch the keyboard mapping functionality was taken over by systemd's hardware database functionality, and I wonder whether that's where the problem lies.

Any pointers to solutions would be greatly appreciated.
Last edited by qazwsxedc on 2019-02-08 21:12, edited 1 time in total.
qazwsxedc
 
Posts: 7
Joined: 2016-10-30 08:30

Re: Zoom key/slider of Microsoft Ergonomic Keyboard 4000

Postby bw123 » 2019-02-08 14:27

...
Between Wheezy and Stretch the keyboard mapping functionality was taken over by systemd's hardware database functionality, and I wonder whether that's where the problem lies.

Could be, libinput as default input driver also is new in stretch so it could be part of the problem also. Check the bug reports?
Setup xserver-xorg-input-evdev and see what happens? Should be harmless and easy to reverse...

Code: Select all
/lib/udev/hwdb.d/60-keyboard.hwdb                                     35695/54111              65%
# Microsoft
###########################################################

# Microsoft Natural Ergonomic Keyboard 4000
evdev:input:b0003v045Ep00DB*
 KEYBOARD_KEY_c022d=zoomin
 KEYBOARD_KEY_c022e=zoomout
User avatar
bw123
 
Posts: 3787
Joined: 2011-05-09 06:02

Re: Zoom key/slider of Microsoft Ergonomic Keyboard 4000

Postby qazwsxedc » 2019-02-08 15:15

On the Stretch install I've tried both libinput and evdev, same result for both. As in, all keys generate xev events except the zoom slider. Went through a trial of commenting out alternative pointer and keyboard sections of /usr/share/X11/xorg.conf.d/40-libinput.conf and /usr/share/X11/xorg.conf.d/10-evdev.conf in case the zoom slider was misrecognized as a pointer device, but no luck there either.

On the old Wheezy box the zoom slider does generate xev events, so it definitely is a config issue. I'm running out of ideas where to look, though.
qazwsxedc
 
Posts: 7
Joined: 2016-10-30 08:30

Re: Zoom key/slider of Microsoft Ergonomic Keyboard 4000

Postby bw123 » 2019-02-08 15:24

does the evdev:input: ID match the device tag shown from looking at the kb with lsusb?

You can create new rules in /etc/udev/hwdb.d there should be instructions in one or all of the hwdb files. You can match by name also, that might be easier.

oh yeh, the settings should? show up in 'udevadm info /dev/input/eventX' where X is the correct event. Probably find the right eventX with xinput, or look around /dev/input/by-path or something like that...
User avatar
bw123
 
Posts: 3787
Joined: 2011-05-09 06:02

Re: Zoom key/slider of Microsoft Ergonomic Keyboard 4000

Postby qazwsxedc » 2019-02-08 21:10

bw123 wrote:You can create new rules in /etc/udev/hwdb.d there should be instructions in one or all of the hwdb files.

Give that man a cigar. Bugs located. Got it working properly now.

The instructions in /lib/udev/hwdb.d/60-keyboard.hwdb refer to refreshing the hwdb.bin with changes made in /etc/udev/hwdb.d/*.hwdb files by using
Code: Select all
udevadm hwdb --update
udevadm trigger /dev/input/eventXX


But according to "man udevadm" or "udevadm --help" the "hwdb" command no longer exists:
Code: Select all
# udevadm --help
udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]

Send control commands or test the device manager.

Commands:
  info          Query sysfs or the udev database
  trigger       Request events from the kernel
  settle        Wait for pending udev events
  control       Control the udev daemon
  monitor       Listen to kernel and udev events
  test          Test an event run
  test-builtin  Test a built-in command


This functionality should, according to the docs, now reside in systemd-hwdb:
Code: Select all
# systemd-hwdb -h
Usage: systemd-hwdb OPTIONS COMMAND

Update or query the hardware database.

  -h --help            Show this help
     --version         Show package version
     --usr             Generate in /lib/udev instead of /etc/udev
  -r --root=PATH       Alternative root path in the filesystem

Commands:
  update               Update the hwdb database
  query MODALIAS       Query database and print result


So I used "systemd-hwdb update" earlier.

BUT: It doesn't work as advertised. "systemd-hwdb update" will put a new version of hwdb.bin into /etc/udev, but that will not include any changes made in additional .hwdb files under /etc/udev/hwdb.d
"udevadm hwdb --update" (which is now, strictly speaking, undocumented) followed by "udevadm trigger /dev/input/eventXX" does work, and updates hwdb.bin properly. So that's one bug in the functionality of systemd-hwdb, and another bug in the documentation of udevadm.

The lack of xev event traces or showkey output from the zoom slider which I mentioned earlier seems to have been irrelevant. evdev input ID and USB device tag were matching all the time, too. What clinched it for me was being pointed at the output from "udevadm info /dev/input/event1". After running "systemd-hwdb update" it still showed the default mappings from /lib/udev/hwdb.d/60-keyboard.hwdb, not the remappings I had put into /etc/udev/hwdb.d/70-keyboard-custom.hwdb. That was the smoking gun.
qazwsxedc
 
Posts: 7
Joined: 2016-10-30 08:30

Re: [SOLVED] Zoom key/slider Microsoft Ergonomic Keyboard 40

Postby qazwsxedc » 2019-02-09 19:53

Postscript: After a reboot the zoom slider did not work again. The culprit was systemd-hwdb-update.service being started by systemd, which eventually runs "systemd-hwdb update", overwriting hwdb.bin. Therefore the command sequence to ensure that remapping of the zoom slider works and stays working should be:
Code: Select all
systemctl mask systemd-hwdb-update.service
udevadm hwdb --update
udevadm trigger /dev/input/eventXX
qazwsxedc
 
Posts: 7
Joined: 2016-10-30 08:30

Re: [SOLVED] Zoom key/slider Microsoft Ergonomic Keyboard 40

Postby bw123 » 2019-02-09 21:25

That's odd, it works correctly here. I have a few local rules for touchpad dimensions and other things. If you can show it simply like this, then you could report it in debian bugtracker with the workaround, but I don't think systemd maintainers accept bugs for older versions, they will just tell you to try the latest... I wouldn;t go to a lot of trouble for it but it's nice to let other debian users know how to fix it.

Code: Select all
# head -n2 61-evdev-local.hwdb
# Dell Inspiron Mini 1012
evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnDellInc.:pnInspiron1012*
:/etc/udev/hwdb.d# mv 61-evdev-local.hwdb 61-evdev-local.hwdb.bak
:/etc/udev/hwdb.d# systemd-hwdb update
:/etc/udev/hwdb.d# systemd-hwdb query "evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnDellInc.:pnInspiron1012*"
:/etc/udev/hwdb.d# mv 61-evdev-local.hwdb.bak 61-evdev-local.hwdb
:/etc/udev/hwdb.d# systemd-hwdb update
:/etc/udev/hwdb.d# systemd-hwdb query "evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnDellInc.:pnInspiron1012*"
EVDEV_ABS_00=1274:5723:57
EVDEV_ABS_01=915:4956:106
EVDEV_ABS_35=1274:5723:57
EVDEV_ABS_36=915:4956:106
# systemd --version
systemd 232
User avatar
bw123
 
Posts: 3787
Joined: 2011-05-09 06:02

Re: [SOLVED] Zoom key/slider Microsoft Ergonomic Keyboard 40

Postby qazwsxedc » 2019-02-11 09:49

I have reported it as bug in udev, because it's udev's incorrect documentation that threw me in the first place.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=921771

Thank you for your pointers. Enjoy the cigar.
qazwsxedc
 
Posts: 7
Joined: 2016-10-30 08:30


Return to Hardware

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable