Skip to content

A fork of a fork of the Linux mouse driver with acceleration. Now with GUI and some other improvements!

License

Notifications You must be signed in to change notification settings

AndyFilter/YeetMouse

 
 

Repository files navigation

Description

The LEETMOUSE kernelmodule enables different acceleration modes for your mouse on Linux and is heavily inspired by previous works from Povohat’s mouse driver for Windows. LEETMOUSE basically fuses the original Linux USB mouse driver code with the acceleration code-base and has been initially developed by Christopher Williams. Since the 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

  • Clone this repository, copy driver/config.sample.h to /driver/config.h and edit it in your favorite text editor. Change the defines at the top of config.h to match your desired acceleration settings. But keep in mind that, the values in the config.h have to be the long long representations of their Fixed-Point data (limitation of C compile time constants), so it might be better to just do everything from the GUI.
  • Make sure, you have the required toolchains (e.g. base-devel on Arch or build-essentials on Debian) installed as well as the linux-headers for your installed kernel.

Running the GUI

Prerequisites:

  • OpenGL (you most likely already have it)
  • GLFW3, which can be installed via these commands:
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

# Create the PKGBUILD, copy associated files and run makepkg
./scripts/build_arch.sh
# Run pacman on the created package
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 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

# Install the driver and activate the dkms 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

# Unbind all mice from the driver
sudo /usr/lib/udev/leetmouse_manage unbind_all
# Uninstall the driver
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 here.

TODOS

AUR package releaseOnce it reaches version 1.0 (basically after Im happy with it)
dpkg package for Debian based systemsAfter AUR release
Feature parity with Povohats driver and later even RawAccelWhen I find time - Definitely after above milestones
Optimize some Fixed-Point functionsDone
GUI to configure the acceleration parametersDone
Move to Fixed-Point arithmeticDone
External interface for dynamically pushing acceleration parametersDone
Fixing the only vertical scrolling bugDone
Easier installation & bindingDone
DKMS supportDone
PKGBUILD for Arch based systemsDone

About

A fork of a fork of the Linux mouse driver with acceleration. Now with GUI and some other improvements!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 72.1%
  • C++ 21.0%
  • Shell 2.6%
  • Nix 2.4%
  • Makefile 1.9%