feat(automouse): adds automouse scroll threshold parameter (#416)

This commit is contained in:
Florian Didron
2025-09-04 09:34:28 +07:00
committed by GitHub
parent 624cce85d0
commit 39f7814943
2 changed files with 4 additions and 1 deletions

View File

@@ -243,7 +243,7 @@ __attribute__((weak)) bool auto_mouse_activation(report_mouse_t mouse_report) {
auto_mouse_context.total_mouse_movement.y += mouse_report.y;
auto_mouse_context.total_mouse_movement.h += mouse_report.h;
auto_mouse_context.total_mouse_movement.v += mouse_report.v;
return abs(auto_mouse_context.total_mouse_movement.x) > AUTO_MOUSE_THRESHOLD || abs(auto_mouse_context.total_mouse_movement.y) > AUTO_MOUSE_THRESHOLD || abs(auto_mouse_context.total_mouse_movement.h) > AUTO_MOUSE_THRESHOLD || abs(auto_mouse_context.total_mouse_movement.v) > AUTO_MOUSE_THRESHOLD || mouse_report.buttons;
return abs(auto_mouse_context.total_mouse_movement.x) > AUTO_MOUSE_THRESHOLD || abs(auto_mouse_context.total_mouse_movement.y) > AUTO_MOUSE_THRESHOLD || abs(auto_mouse_context.total_mouse_movement.h) > AUTO_MOUSE_SCROLL_THRESHOLD || abs(auto_mouse_context.total_mouse_movement.v) > AUTO_MOUSE_SCROLL_THRESHOLD || mouse_report.buttons;
}
/**

View File

@@ -45,6 +45,9 @@
#ifndef AUTO_MOUSE_THRESHOLD
# define AUTO_MOUSE_THRESHOLD 10
#endif
#ifndef AUTO_MOUSE_SCROLL_THRESHOLD
# define AUTO_MOUSE_SCROLL_THRESHOLD AUTO_MOUSE_THRESHOLD
#endif
/* data structure */
typedef struct {