mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-28 03:51:15 +00:00
working
This commit is contained in:
parent
c98f57fa7d
commit
fa24602e74
@ -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
|
||||
|
@ -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) {
|
||||
current_position = ra;
|
||||
mouse_report.v = 1;
|
||||
} else if (delta <= -SCROLL_DISTANCE) {
|
||||
current_position = ra;
|
||||
mouse_report.v = -1;
|
||||
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 < 128) {
|
||||
current_position = ra;
|
||||
mouse_report.v = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
#endif
|
||||
|
||||
return pointing_device_task_user(mouse_report);
|
||||
|
Loading…
Reference in New Issue
Block a user