I am using a Logitech Trackman Marble Trackball on Ubuntu 22.04, Gnome Shell 42, Wayland.
I wish to simulate a middle mouse click with one of the extra side buttons, but it seems I am able to synthesize any type of button except the middle button.
- I have created file at
/etc/udev/hwdb.d/71-logitech-trackman.hwdb
like so:
evdev:name:Logitech USB Trackball:*
KEYBOARD_KEY_90004=btn_middle
I then run:
sudo systemd-hwdb update
sudo udevadm trigger
And physically reconnect the device.
- Running
sudo udevadm info /dev/input/event8 | grep btn_middle
shows that the mapping has taken effect.
- Running
sudo evtest /dev/input/event8
outputs the correct mapping like so:
Event: time 1689266776.764313, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1689266776.764313, type 1 (EV_KEY), code 274 (BTN_MIDDLE), value 1
- However, running
sudo libinput debug-events --device /dev/input/event8
does not emit any output when I press the remapped button (though it does output correct lines for all other events).
Oddly, libinput
does emit output if I choose any other target event, such as btn_left
, btn_right
, or even other buttons that the device does not have, such as btn_back
, and these clicks are correctly reflected in the GUI. It appears to be only the middle button that cannot be emulated.
The behaviour is the same if I attempt to remap any of the four physical buttons.
What could be preventing the middle mouse button mapping from working?