Skip to content

Commit

Permalink
fix(bkb) drag-scroll was dumping spill-over distance >
Browse files Browse the repository at this point in the history
reducing effectively the attenable scroll-speed.
From another POV, scroll-buffer's input-speed division was getting rid
of the remainder.

The effect was a subtle jerk with sensible defaults (SCROLL_DPI: 100)
but in higher DPIs or
with maccel[1] enabled and redirecting to drag-scroll,
all expected addionall velocity, dissipates.

[1]: https://github.com/finrod09/qmk_userspace_features/tree/maccel-assym_s_curve/maccel
  • Loading branch information
ankostis committed Feb 20, 2024
1 parent 78b6376 commit eb496a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions keyboards/bastardkb/charybdis/charybdis.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ static void pointing_device_task_charybdis(report_mouse_t* mouse_report) {
# endif // CHARYBDIS_DRAGSCROLL_REVERSE_Y
mouse_report->x = 0;
mouse_report->y = 0;
if (abs(scroll_buffer_x) > CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) {
if (abs(scroll_buffer_x) >= CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) {
mouse_report->h = scroll_buffer_x > 0 ? 1 : -1;
scroll_buffer_x = 0;
scroll_buffer_x += (scroll_buffer_x > 0? -1 : 1) * CHARYBDIS_DRAGSCROLL_BUFFER_SIZE;
}
if (abs(scroll_buffer_y) > CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) {
if (abs(scroll_buffer_y) >= CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) {
mouse_report->v = scroll_buffer_y > 0 ? 1 : -1;
scroll_buffer_y = 0;
scroll_buffer_y += (scroll_buffer_y > 0? -1 : 1) * CHARYBDIS_DRAGSCROLL_BUFFER_SIZE;
}
}
}
Expand Down

0 comments on commit eb496a2

Please sign in to comment.