systemofapwne / leetmouse

A fork of the Linux mouse driver with acceleration
GNU General Public License v2.0
93 stars 10 forks source link

Inverted mouse movement when speed is less than Offset #43

Open jean-vicquemare opened 7 months ago

jean-vicquemare commented 7 months ago

This is my first time actually submitting an issue to github, so apologies if this is the wrong place/format for it. I came across leetmouse looking for a way to get the interaccel/povohat mouse acceleration I was used to on windows working, and was pleased to see pretty much all of the functionality of that driver working well here. Thank you for taking up and maintaining this project!

However, once I properly set my settings in the config.h script, I found a strange issue where my mouse's movements were inverted unless I really cranked my arm. Since the driver was indeed "working" in the sense that acceleration was being applied to my mouse, and that the correct direction was being applied at higher accelerations, I figured that there was something wrong with how the offset parameter was being calculated with regards to direction.

Looking at the accel.c script, I found that the section that determines whether "speed" is above "g_Offset" is not properly resetting "speed" to 1 if "speed" is at or below "g_Offset" (Line 170 or so). In my own script, I managed to fix this by adding an else{} statement immediately below the apply acceleration if{} tree that reset that set speed to 1. After some testing, it looks like this stops the driver from inverting mouse inputs.

Again, thank you for your work maintaining this repo!

systemofapwne commented 7 months ago

Could you please create a pull-request for the change? Thank you