X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=common%2Fmousekey.c;h=23469476e264fd8bacdc56682dcf2e23c5a84c2b;hb=a9f5f201ad6b009675fdf16c4447033cc2ac0995;hp=b8af3e59c7668a8611a66b4aeb2d7e7e695d9abb;hpb=3c822b511e7af60332a7e5a938c08bafb2516ba3;p=max%2Ftmk_keyboard.git
diff --git a/common/mousekey.c b/common/mousekey.c
index b8af3e59..23469476 100644
--- a/common/mousekey.c
+++ b/common/mousekey.c
@@ -16,7 +16,6 @@ along with this program. If not, see .
*/
#include
-#include
#include "keycode.h"
#include "host.h"
#include "timer.h"
@@ -26,6 +25,7 @@ along with this program. If not, see .
+static report_mouse_t mouse_report = {};
static uint8_t mousekey_repeat = 0;
static uint8_t mousekey_accel = 0;
@@ -86,7 +86,7 @@ static uint8_t wheel_unit(void)
unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed);
} else if (mousekey_repeat == 0) {
unit = MOUSEKEY_WHEEL_DELTA;
- } else if (mousekey_repeat >= mk_time_to_max) {
+ } else if (mousekey_repeat >= mk_wheel_time_to_max) {
unit = MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed;
} else {
unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed * mousekey_repeat) / mk_wheel_time_to_max;
@@ -187,10 +187,10 @@ static void mousekey_debug(void)
if (!debug_mouse) return;
print("mousekey [btn|x y v h](rep/acl): [");
phex(mouse_report.buttons); print("|");
- phex(mouse_report.x); print(" ");
- phex(mouse_report.y); print(" ");
- phex(mouse_report.v); print(" ");
- phex(mouse_report.h); print("](");
- phex(mousekey_repeat); print("/");
- phex(mousekey_accel); print(")\n");
+ print_decs(mouse_report.x); print(" ");
+ print_decs(mouse_report.y); print(" ");
+ print_decs(mouse_report.v); print(" ");
+ print_decs(mouse_report.h); print("](");
+ print_dec(mousekey_repeat); print("/");
+ print_dec(mousekey_accel); print(")\n");
}