# fastmouse Fastmouse is a kernel patch (and collection of tiny bash scripts) which provide the ability to rotate and slow your mouse. Inspired by [the leetmouse kernel module](https://github.com/systemofapwne/leetmouse), Fastmouse aims provides a more robust means of modifying your mouse inputs through direct modification of the HID driver provided by the Linux kernel. As we only operate in integer space, we provide higher precision and minimise information loss. # Usage Fastmouse currently exposes three parameters in the `/sys/module/hid/parameters` directory. - `division`: A positive integer representing the amount of inputs to buffer before emitting an event. Useful for reducing mouse sensitivity - essentially the same as dividing DPI. '1' does nothing, '2' omits one event for every two, and so on. - `rise`: An integer describing the vertical component of the triangle used to calculate mouse rotation. - `run`: An integer describing the horizontal component of the triangle used to calculate mouse rotation. ##### fastmouse Wraps the arguments specified after `--` with a Fastmouse division - also computes and sets a KDE-specific calculation for keeping the mouse moving at the same speed on the desktop. Effectively, this seamlessly drops the DPI of the mouse, and then restores the original configuration once the program exits. With `fastmouse` in your path, usage would look like this: ```console fastmouse 10 -- my_program_which_doesn't_work_with_high_dpi_mice_or_doesn't_allow_me_to_lower_sens ``` ##### set_rotation Set_rotation computes and sets optimal values for the exposed rise and run parameters for any desired mouse rotation angle. Usage is simply: ```console set_rotation my_angle_in_degrees ``` # Installation Installation of Fastmouse is dependent on your OS configuration - it requires you to build the Linux kernel with the patch `fastmouse.patch` applied. Installation has succeeded when the following command prints `1`. ```console $ cat /sys/module/hid/parameters/division ``` # Building from Source To download the latest available release, clone this repository. ```console $ git clone https://git.nj3.xyz/fastmouse --recurse-submodules $ cd ./fastmouse ``` Compiling from source is a two step process. To avoid forking the Linux tree, we use linux as a submodule and manipulate files as necessary during compilation. Simply run `setup.sh` to create symlinks from the linux tree to our `src` directory. ```console $ ./setup.sh ``` Create a patch from `src` by running `patch.sh`. ```console $ ./patch.sh ``` `leetmouse.patch` will be in the placed in the topmost directory.