Skip to content

AndyFilter/YeetMouse

 
 

Repository files navigation

Description

YeetMouse is a kernel module that allows for fast and customizable mouse acceleration. I created YeetMouse to build upon the great work of Klaus Zipfel’s LeetMouse and add features such as Jump (at first it was mostly it, the Jump acceleration mode). But it quickly grew into something bigger as I decided to add a GUI to it for better control.

media/YeetMouseGithub.gif

Installation & Uninstallation

Preparation & Configuration

  • Clone this repository, find the settings you’re most comfortable with, using GUI, change the defines in the config.h (More on this in the FAQ section about persistent settings).
  • 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

For Arch and Manjaro, 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.

Ubuntu (tested on 24.04 and 20.04)

Simply use the installation and uninstallation scripts, sudo ./install.sh and sudo ./uninstall.sh respectively. If something doesn’t work as expected, try installing manually as stated in section Other distros, and check all the error logs.

NixOS

Please refer to NixOS instructions.

Other distros

Other distributions’ package-managers are not yet supported and thus need a manual installation.

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.

FAQ

How to set custom parameter value?

  • Ctrl + Left Click on the parameter box to start inputting the values manually.

Settings are not preserved between reboots

  • This is (unfortunately) how things are done on most distros, for security reasons I presume. But there is a way so save the settings. All You need to do is find the values You like and Export them to a config.h format like so:

    https://private-user-images.githubusercontent.com/69699046/397979220-ad0fc1a9-5616-4b41-b453-7398dbb9993c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4MDA4ODksIm5iZiI6MTczOTgwMDU4OSwicGF0aCI6Ii82OTY5OTA0Ni8zOTc5NzkyMjAtYWQwZmMxYTktNTYxNi00YjQxLWI0NTMtNzM5OGRiYjk5OTNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE3VDEzNTYyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg2YTg0YjI1OTAxMDAwMDUxOWQ0YzNhMzExZmM5NWQ5MzQ3NWE4YjQ4YzcxMTNlYWUyNTE1ZTYzMjMyMGU1M2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.bhGe7Igfl56zRPajmUchH2ppTpsGfuD1DyXWjYttQzo

    Then simply replace the config.h file located in /driver (or create a one), and reinstall the driver.

Mouse feels off (too fast / slow)

  • On some distros (for example Ubuntu 20.04) system adds an additional sensitivity on top of the driver. To combat this You’ll need to configure the settings correctly. This is system dependant, but for Ubuntu 20.04 users, the exact sensitivity value is -0.666, to apply that, simply use gsettings set org.gnome.desktop.peripherals.mouse speed -0.666

How do I convert my RawAccel settings?

  • For the simple modes like Linear, Classic, Power just use the RawAccel’s values (same for Jump).
  • For Motivity and Natural, You’re out of luck for now. Motivity is implemented, but it does not support Gain. Natural on the other hand is not implemented, and not planned as of for now.
  • LuT (Look up Table) is just what you put in it, there is no difference between YeetMouse and RawAccel.
  • Keep in mind that the names are not 1:1 for every parameter.
  • To check how Your new curve compares to RawAccel’s, just take a screenshot of RawAccel with your curve and compare the two.

Fixed-Point Performance 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.

Releases

No releases published

Packages

No packages published

Languages

  • C 63.9%
  • C++ 30.0%
  • Shell 2.3%
  • Nix 2.1%
  • Makefile 1.7%