feat: adds aim/turbo mode

This commit is contained in:
Florian Didron
2025-06-17 18:21:06 +07:00
parent f11ebc3a71
commit 574b2798a4
2 changed files with 18 additions and 1 deletions

View File

@@ -5,8 +5,22 @@ float scroll_accumulated_h = 0;
float scroll_accumulated_v = 0;
bool set_scrolling = false;
bool navigator_turbo = false;
bool navigator_aim = false;
report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) {
// Turbo mode is used to increase the speed of the mouse cursor
// by multiplying the x and y values by a factor.
if (navigator_turbo) {
mouse_report.x *= NAVIGATOR_TURBO_MULTIPLIER;
mouse_report.y *= NAVIGATOR_TURBO_MULTIPLIER;
}
// Aim mode is used to slow down the mouse cursor
// by dividing the x and y values by a factor.
if (navigator_aim) {
mouse_report.x /= NAVIGATOR_AIM_DIVIDER;
mouse_report.y /= NAVIGATOR_AIM_DIVIDER;
}
if (set_scrolling) {
scroll_accumulated_h += (float)mouse_report.x / NAVIGATOR_SCROLL_DIVIDER;
scroll_accumulated_v += (float)mouse_report.y / NAVIGATOR_SCROLL_DIVIDER;

View File

@@ -1,4 +1,7 @@
#pragma once
#ifndef NAVIGATOR_SCROLL_DIVIDER
# define NAVIGATOR_SCROLL_DIVIDER 10
#define NAVIGATOR_SCROLL_DIVIDER 10
#endif
#define NAVIGATOR_TURBO_MULTIPLIER 3
#define NAVIGATOR_AIM_DIVIDER 3