# 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 to provide a more robust means of modifying your mouse inputs through direct modification of the HID driver in the Linux kernel. Additionally, as we only operate in integer space, we provide higher precision and avoid kernel floating-point pitfalls. # 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 an input 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_doesnt_work_with_high_dpi_mice_or_doesnt_allow_me_to_lower_sens ``` ##### set_rotation `set_rotation` computes and sets optimal values for the exposed rise and run parameters of any desired mouse rotation angle. It is recommended to use this script over manually calculated values as `set_rotation` produces values which describe the desired angle with the greatest precision available. Usage is simply: ```console $ set_rotation my_angle_in_degrees ``` # Installation Installation is dependent on your OS configuration - it requires that you 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 ``` First, you need to setup the kernel build in `kernel/` to whatever suits your needs. If you don't know what to do here, just save the defaults of menuconfig via: ```console $ cd ./linux $ make menuconfig $ cd ../ ``` We use cmake to as our build system, which consists of three steps. First, cmake will attempt to build fastmouse with a test runner via googletest. If this succeeds, cmake will make sure that all tests pass before moving on to the second step: attempting to build with whatever linux kernel is present in `linux/`. If this build succeeds, fastmouse should be usable as a patch (in theory). You can build the project by running: ```console $ cmake ./ && make ``` If everything went well, `leetmouse.patch` will be in the placed in the topmost directory.