This commit is contained in:
ploopyco 2025-05-20 14:03:25 -04:00
parent c98f57fa7d
commit fa24602e74
2 changed files with 27 additions and 7 deletions

View File

@ -18,6 +18,8 @@
#pragma once
#define POINTING_DEVICE_HIRES_SCROLL_ENABLE 0
#define I2C_DRIVER I2CD1
#define I2C1_SDA_PIN GP22
#define I2C1_SCL_PIN GP23

View File

@ -21,7 +21,6 @@
#include "opt_encoder.h"
#include "as5600.h"
#include "print.h"
#include "wait.h"
// for legacy support
#if defined(OPT_DEBOUNCE) && !defined(PLOOPY_SCROLL_DEBOUNCE)
@ -185,13 +184,32 @@ report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) {
delta += 4096;
}
if (delta >= SCROLL_DISTANCE) {
if (is_hires_scroll_on()) {
// Establish a deadzone to prevent spurious inputs
// 4 was found to be a good number experimentally
if (delta > 4 || delta < -4) {
current_position = ra;
mouse_report.v = delta;
}
} else {
// Certain operating systems, like MacOS, don't play well with the
// high-res scrolling implementation. For more details, see:
// https://github.com/qmk/qmk_firmware/issues/17585#issuecomment-2325248167
// 128 gives the scroll wheels "ticks".
if (delta > 128) {
current_position = ra;
mouse_report.v = 1;
} else if (delta <= -SCROLL_DISTANCE) {
} else if (delta < 128) {
current_position = ra;
mouse_report.v = -1;
}
}
/*
*/
#endif
return pointing_device_task_user(mouse_report);