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.hwdblike 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_middleshows that the mapping has taken effect. - Running
sudo evtest /dev/input/event8outputs 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/event8does 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?
It does not use udev, instead a separate program to remap your side buttons to middle mouse.
My searches show others have been able to remap these exact keys to middle mouse. Any chance you have some other operation/program blocking middle mouse you may have forgotten of?
– AlwaysTalkingAboutMyDog Jul 20 '23 at 11:06