https://github.com/gaul/libinput-force-middle-click-emulation
force libinput to emulate a middle click when pressing left and right buttons simultaneously
https://github.com/gaul/libinput-force-middle-click-emulation
ld-preload libinput middle-click mutter wayland
Last synced: 5 days ago
JSON representation
force libinput to emulate a middle click when pressing left and right buttons simultaneously
- Host: GitHub
- URL: https://github.com/gaul/libinput-force-middle-click-emulation
- Owner: gaul
- License: mit
- Created: 2018-10-04T18:36:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-01T05:33:46.000Z (about 5 years ago)
- Last Synced: 2024-11-01T08:50:41.952Z (6 months ago)
- Topics: ld-preload, libinput, middle-click, mutter, wayland
- Language: C
- Homepage:
- Size: 1.95 KB
- Stars: 20
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-ld-preload - libinput-force-middle-click-emulation - force libinput to emulate a middle click when pressing left and right buttons simultaneously (Libraries)
README
# libinput-force-middle-click-emulation
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.## Information for users of mutter version 3.36.1 or newer
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:
```bash
gsettings set org.gnome.desktop.peripherals.mouse middle-click-emulation true
```## Installation
Build `hook.so` then configure `libinput` to `LD_PRELOAD` it:
```bash
make
echo 'export LD_PRELOAD="$LD_PRELOAD /path/to/hook.so"' | sudo tee -a /etc/profile.d/libinput.sh
```Log out and log in to enable.
## References
* [GNOME mutter issue](https://gitlab.gnome.org/GNOME/mutter/issues/238)
* [libinput documentation](https://wayland.freedesktop.org/libinput/doc/latest/middle-button-emulation.html)
* Inspired by [scroll-emulation](https://github.com/PeterCxy/scroll-emulation)## License
* MIT