-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement kinetic mouse movement algorithm #6739
Conversation
Any updates on this pull request? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the docs and comments, all look good, just a teeny-tiny suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jceb, I reviewed your code, very well documented and implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a suggestion, please review it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, documentation confused me before I read the code, which I have suggested changes for improving to make it clear how kinetic mode is different from acceleration mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs are in place, no requests have been raised. I think it just needs a little more time. @drashna what do you think about merging it? |
This PR needs to be rebased. |
229e7f7
to
1e40fb5
Compare
Rebase done. |
Not sure if the github ui is slow a bit today or something, but it still shows one conflict ( |
Co-Authored-By: lf <software@lfcode.ca>
Co-Authored-By: lf <software@lfcode.ca>
1e40fb5
to
56e6906
Compare
Thank you for the hint. Somehow I couldn't get my git to force-push the changes. Very strange but now it worked :-D |
If I may:
(I am looking into the older qmk/master code, fixed by hand in order to expose your algorithm... thence the possibility of errors.) |
Thank you for your feedback. There's another kinetic implementation at https://github.com/liyang/qmk_firmware that might be of interest to you. |
Honestly? I've got your implementation running and am happy with it, and don't want to waste any more time on another O:-). But thanks nevertheless! |
How could the double space in line 114 slip through? It was one of the very first suggestions to remove it. |
Unfortunately GitHub doesn't tell you when a suggestion is resolved manually or by it actually being applied. |
@fauxpark Am I looking in the wrong branch? What I meant to say is it’s not actually applied. Or rather it had been applied and somebody must have undone it. |
* Implement kinetic mouse movement algorithm * Adjust mouse wheel speed * Remove unused math.h include * Wrap mouse_timer definition in ifdef * Replace double space by single space * Clarify documentation of kinetic mouse speed Co-Authored-By: lf <software@lfcode.ca> * Clarify documentation of kinetic mouse speed Co-Authored-By: lf <software@lfcode.ca> * Remove superfluous definition of speed * fix(variable): remove unused variable Co-authored-by: lf <software@lfcode.ca>
Description
I implemented the kinetic/quadratic mouse acceleration algorithm. The algorithm is not the one from the UHK but a newly created one that's able to compute the current speed at any given time instead of relying on a compounding mechanism that just computes the increment.
Overall, the cursor acceleration feels very similar to the UHK. However, feedback and improvements are welcome in order to make it as usable as possible.
This algorithm requires a very low
MOUSEKEY_INTERVAL
in order to produce smooth movements. What's possible highly depends on the micro processor. I did my tests on the elite-c which is pro micro compatible. It was able to deliver 125 events per second which I set as the default value ifMK_KINETIC_SPEED
is defined.I wrote a small utility https://github.com/jceb/bin/blob/master/mouseevents that helps to measure the maximum number of mouse events that can be sent by the micro processor. If you try out this algorithm it should help find the right setting for
MOUSEKEY_INTERVAL
.Types of Changes
Issues Fixed or Closed by This PR
Checklist