mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-28 11:59:21 +00:00
working
This commit is contained in:
parent
c98f57fa7d
commit
fa24602e74
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#define POINTING_DEVICE_HIRES_SCROLL_ENABLE 0
|
||||||
|
|
||||||
#define I2C_DRIVER I2CD1
|
#define I2C_DRIVER I2CD1
|
||||||
#define I2C1_SDA_PIN GP22
|
#define I2C1_SDA_PIN GP22
|
||||||
#define I2C1_SCL_PIN GP23
|
#define I2C1_SCL_PIN GP23
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include "opt_encoder.h"
|
#include "opt_encoder.h"
|
||||||
#include "as5600.h"
|
#include "as5600.h"
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
#include "wait.h"
|
|
||||||
|
|
||||||
// for legacy support
|
// for legacy support
|
||||||
#if defined(OPT_DEBOUNCE) && !defined(PLOOPY_SCROLL_DEBOUNCE)
|
#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;
|
delta += 4096;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delta >= SCROLL_DISTANCE) {
|
if (is_hires_scroll_on()) {
|
||||||
current_position = ra;
|
// Establish a deadzone to prevent spurious inputs
|
||||||
mouse_report.v = 1;
|
// 4 was found to be a good number experimentally
|
||||||
} else if (delta <= -SCROLL_DISTANCE) {
|
if (delta > 4 || delta < -4) {
|
||||||
current_position = ra;
|
current_position = ra;
|
||||||
mouse_report.v = -1;
|
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
|
#endif
|
||||||
|
|
||||||
return pointing_device_task_user(mouse_report);
|
return pointing_device_task_user(mouse_report);
|
||||||
|
Loading…
Reference in New Issue
Block a user