From 9aacf90e6c9f0f1f856dabd1006a24804c40aebc Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 12 Sep 2025 18:04:11 -0700 Subject: voyager: Add scroll toggle button Pressing and holding this button will change the mode of the track ball from moving the mouse to scrolling. --- keyboards/zsa/voyager/keymaps/ryuk/keymap.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/keyboards/zsa/voyager/keymaps/ryuk/keymap.c b/keyboards/zsa/voyager/keymaps/ryuk/keymap.c index 3c19049..95e6391 100644 --- a/keyboards/zsa/voyager/keymaps/ryuk/keymap.c +++ b/keyboards/zsa/voyager/keymaps/ryuk/keymap.c @@ -4,6 +4,8 @@ #include QMK_KEYBOARD_H +extern bool set_scrolling; + enum layers { BASE, SYMBOL, @@ -11,6 +13,8 @@ enum layers { MOUSE, }; +enum my_keycodes { SCROLON = SAFE_RANGE }; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format off /* Keymap 0: Basic layer @@ -75,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MS_BTN1, _______, MS_BTN2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______ + _______, _______, _______, SCROLON ), // clang-format on }; @@ -84,3 +88,13 @@ void pointing_device_init_user(void) { set_auto_mouse_layer(MOUSE); set_auto_mouse_enable(true); } + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case SCROLON: + set_scrolling = record->event.pressed; + return false; + } + + return true; +} -- cgit v1.3-2-g0d8e