You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This allows you to toggle between scrolling and cursor movement by pressing the DRAG_SCROLL key.
436
436
437
+
### Advanced Drag Scroll
438
+
439
+
Sometimes, like with the Cirque trackpad, you will run into issues where the scrolling may be too fast.
440
+
441
+
Here is a slightly more advanced example of drag scrolling. You will be able to change the scroll speed based on the values in set in `SCROLL_DIVISOR_H` and `SCROLL_DIVISOR_V`. This bit of code is also set up so that instead of toggling the scrolling state with set_scrolling = !set_scrolling, the set_scrolling variable is set directly to record->event.pressed. This way, the drag scrolling will only be active while the DRAG_SCROLL button is held down.
442
+
443
+
```c
444
+
enum custom_keycodes {
445
+
DRAG_SCROLL = SAFE_RANGE,
446
+
};
447
+
448
+
bool set_scrolling = false;
449
+
450
+
// Modify these values to adjust the scrolling speed
451
+
#define SCROLL_DIVISOR_H 8.0
452
+
#define SCROLL_DIVISOR_V 8.0
453
+
454
+
// Variables to store accumulated scroll values
455
+
float scroll_accumulated_h = 0;
456
+
float scroll_accumulated_v = 0;
457
+
458
+
// Function to handle mouse reports and perform drag scrolling
0 commit comments