Skip to content
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

Re-fix Mousekey Movements #5740

Merged
merged 2 commits into from
May 6, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Re-fix Mousekey Movements
After the new movement model was instroduced, it broke diagonal momement, again.  Reapplying fix from #3147 to both old and new acceleration method.
  • Loading branch information
drashna committed Apr 30, 2019
commit 034b50251e43dde06ead46d7ce739d2492e48114
4 changes: 4 additions & 0 deletions tmk_core/common/mousekey.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ void mousekey_task(void) {
/* diagonal move [1/sqrt(2)] */
if (mouse_report.x && mouse_report.y) {
mouse_report.x = times_inv_sqrt2(mouse_report.x);
mouse_report.x = mouse_report.x == 0 ? 1 : mouse_report.x;
drashna marked this conversation as resolved.
Show resolved Hide resolved
mouse_report.y = times_inv_sqrt2(mouse_report.y);
mouse_report.y = mouse_report.y == 0 ? 1 : mouse_report.y;
drashna marked this conversation as resolved.
Show resolved Hide resolved
}
if (mouse_report.v > 0) mouse_report.v = wheel_unit();
if (mouse_report.v < 0) mouse_report.v = wheel_unit() * -1;
Expand Down Expand Up @@ -232,7 +234,9 @@ void adjust_speed(void) {
// adjust for diagonals
if (mouse_report.x && mouse_report.y) {
mouse_report.x = times_inv_sqrt2(mouse_report.x);
mouse_report.x = mouse_report.x == 0 ? 1 : mouse_report.x;
drashna marked this conversation as resolved.
Show resolved Hide resolved
mouse_report.y = times_inv_sqrt2(mouse_report.y);
mouse_report.y = mouse_report.y == 0 ? 1 : mouse_report.y;
drashna marked this conversation as resolved.
Show resolved Hide resolved
}
if (mouse_report.h && mouse_report.v) {
mouse_report.h = times_inv_sqrt2(mouse_report.h);
Expand Down