Description The =LEETMOUSE= kernel module enables different acceleration modes for your mouse on Linux. =LEETMOUSE= basically fuses the original [[https://github.com/torvalds/linux/blob/master/drivers/hid/usbhid/usbmouse.c][Linux USB mouse driver]] code with the acceleration code-base and has been initially developed by [[https://github.com/chilliams][Christopher Williams]]. Since the [[https://github.com/chilliams/mousedriver][original work]] was in a rough state and seem to have been abandoned, this fork has been started.
[[media/YeetMouseGithub.gif]]
Installation & Uninstallation ** Preparation & Configuration
** Running the GUI *** Prerequisites:
sudo apt-get install libglfw3 sudo apt-get install libglfw3-dev
*** Building To build, go to the gui directory =cd gui/= and run =make=
** Starting Keep in mind that the program needs to be run with sudo privileges*. To run, simply use =sudo -E ./YeetMouseGui=
** Arch/Manjaro Since the maintainer of =LEETMOUSE= is an Arch and Manjaro user, a =PKGBUILD= has been written for seamless integration into pacman.
Installation
./scripts/build_arch.sh
sudo pacman -U pkg/build/leetmouse*.zst
All your mice should now be bound to this driver. They will also automatically bind to it after a reboot. If this did not work, run =sudo /usr/lib/udev/leetmouse_manage bind_all=
Uninstallation
sudo pacman -R leetmouse-driver-dkms
All your mice should now be bound to the generic usbhid driver again.
** NixOS Please refer to [[nix/][NixOS instructions]].
** Other distros Other distributions' package-managers are not yet supported and thus need a manual installation. However Debian based systems are planned. The installation is not yet very polished but eventually will become so.
Installation
Determine the current version of this module by examining the variable =DKMS_VER= in the =Makefile=. It can be e.g. 0.9.0 Run the following commands to build and install the kernel module
sudo make setup_dkms && sudo make udev_install sudo dkms install -m leetmouse-driver -v 0.9.0 # Enter the version you determined from the Makefile earlier in here
(Or you can use the built-in install script like so: =sudo ./install.sh=).
All your mice should now be bound to this driver. They will also automatically bind to it after a reboot. If this did not work, run =sudo /usr/lib/udev/leetmouse_manage bind_all= If this still does not work, there is a major problem
Uninstallation
You again need to know the =version= as described above for the installation
sudo /usr/lib/udev/leetmouse_manage unbind_all
sudo dkms remove -m leetmouse-driver -v 0.9.0 sudo make remove_dkms && sudo make udev_uninstall
(Or you can use the built-in uninstall script like so: =sudo ./uninstall.sh=).
Unplug and replug your mouse or reboot to have your mice bound back to the generic usbhid.
Manual compile, insmod, bind If you want to compile this module only for testing purposes or development, you do not need to install the whole package to your system
Compile the module, remove previously loaded modules and insert it.
make clean && make sudo rmmod leetmouse sudo insmod ./driver/leetmouse.ko
If you did not install the udev rules before via =sudo make udev_install= you need to manually bind your mouse to this driver. You can take a look at =/scripts/bind.sh= for an example on how to determine your mouse's USB address for that. However using the udev rules for development is advised.
Fixed-Point Analysis
[[media/InstructionPerformance.png]]
Instruction | Fixed-Point / FPU | Mop/s | ns/op | Clock cycles/op |
---|---|---|---|---|
Multiplication | Fixed-Point 64 | 542.905367 | 1.911 | 7.029038 |
Fixed-Point 64 (128bit) | 540.682695 | 1.913 | 7.012462 | |
FPU (double) | 788.524105 | 1.29 | 4.722532 | |
Division | Fixed-Point 64 (Precise) | 91.446419 | 11.299 | 41.756461 |
Fixed-Point 64 (128bit) | 203.819151 | 5.097 | 18.797924 | |
FPU (double) | 188.035704 | 5.392 | 19.879064 | |
Exponent | Fixed-Point 64 | 66.550845 | 15.561 | 57.525454 |
Fixed-Point 64 (Fast) | 92.775366 | 11.285 | 41.702182 | |
FPU (double) | 116.396443 | 8.741 | 32.276506 | |
Sqrt | Fixed-Point 64 (Precise) | 18.059895 | 57.307 | 211.97892 |
Fixed-Point 64 | 64.558792 | 15.675 | 57.956097 | |
FPU (double) | 133.474534 | 7.9 | 29.179384 | |
Pow | Fixed-Point 64 | 31.81294 | 32.221 | 119.111214 |
Fixed-Point 64 (Fast) | 40.524527 | 26.043 | 96.310556 | |
FPU (double) | 77.804544 | 17.113 | 63.251944 | |
Log | Fixed-Point 64 | 51.117073 | 21.033 | 77.768302 |
Fixed-Point 64 (Fast) | 61.341951 | 16.638 | 61.497848 | |
FPU (double) | 53.326065 | 19.876 | 73.491065 |
**** /More in-depth performance and precision analysis can be found [[Performance.md][here]]/.