mirror of
https://github.com/zsa/qmk_firmware.git
synced 2026-01-25 14:56:28 +00:00
feat: adds aim/turbo mode
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user