-
-
Notifications
You must be signed in to change notification settings - Fork 38.9k
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
Mousekeys inertia zero friction improvements #23677
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* | ||
* Copyright 2011 Jun Wako <wakojun@gmail.com> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
|
@@ -288,16 +288,16 @@ | |
// simulate acceleration and deceleration | ||
|
||
// deceleration | ||
if ((direction > -1) && (velocity < 0)) | ||
velocity = (velocity + 1) * (256 - MOUSEKEY_FRICTION) / 256; | ||
else if ((direction < 1) && (velocity > 0)) | ||
if (velocity != 0) | ||
velocity = velocity * (256 - MOUSEKEY_FRICTION) / 256; | ||
|
||
// acceleration | ||
if ((direction > 0) && (velocity < mk_time_to_max)) | ||
velocity++; | ||
else if ((direction < 0) && (velocity > -mk_time_to_max)) | ||
velocity--; | ||
else if (velocity <= MOUSEKEY_STOP_SPEED && velocity >= -MOUSEKEY_STOP_SPEED) | ||
velocity = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't quite sure what to do here regarding the styleguide. The guide is unambiguous in saying that braces must always be used... but since I am extending an existing unbraced if/else chain it felt wrong to differently format only my lines in the function. I suppose I could have reformatted the entire function, but I worried that doing so would be considered out-of-scope for the purposes of this PR. |
||
|
||
return velocity; | ||
} | ||
|
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.
My Japanese isn't particularly good. Is it alright that I only updated the English documentation?
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.
Yeah, that's fine.