1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# 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
```
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.
|