A small utility for locking the mouse in a window for gaming in x11 and linux
- C++ 76.6%
- Nix 19.7%
- Makefile 3.7%
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| main.cpp | ||
| Makefile | ||
| README | ||
Mousetrap v1.0 README Mousetrap v1.0 a small utility to trap the mouse inside the window it's currently hovering over I wrote this because I like to play games in a window and some games when run with WINE don't properly lock the mouse to the window, like Starcraft II for instance. Depends on libX11, notify-send and rw access to /tmp Get Started: sudo apt-get install libx11-dev git clone https://github.com/gholken/Mousetrap.git cd Mousetrap make Usage: put the mousetrap binary somewhere in your path setup a hotkey to run the mousetrap bin (I use xfce keyboard settings) running it once locks the mouse to whatever window is under the mouse running it a second time kills the previous one and unlocks the mouse Options: mousetrap -h -n -t x -b x -l x -r x [-h] display this message [-n] turn off notify [-t offset_top=34] set offset from top of window [-b offset_bot=12] set offset from bottom of window [-l offset_left=12] set offset from left side of window [-r offset_right=12] set offset from right side of window [-v] display version info tested on Xubuntu 14.04 Known issues: -If you move the window, the locked area does not move with the window -You can't specify negative values for the border offsets v1.0 2015-07-31 greg@invisiblespaceship.com Initial release. v1.01 2015-08-17 greg@invisiblespaceship.com Fixed some excessive cpu usage