Force libinput to emulate a middle click when pressing left and right buttons simultaneously. This allows GNOME Wayland (and other Wayland compositors that do not expose libinput configuration) to configure the existing libinput functionality.
This is not needed anymore if you use mutter version 3.36.1 or newer.
There it is possible to directly enable middle click emulation:
gsettings set org.gnome.desktop.peripherals.mouse middle-click-emulation trueBuild hook.so then configure libinput to LD_PRELOAD it:
make
echo 'export LD_PRELOAD="$LD_PRELOAD /path/to/hook.so"' | sudo tee -a /etc/profile.d/libinput.shLog out and log in to enable.
- GNOME mutter issue
- libinput documentation
- Inspired by scroll-emulation
- MIT