aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2025-09-12 18:04:11 -0700
committerGravatar Tom Willemse2025-09-12 18:04:11 -0700
commit9aacf90e6c9f0f1f856dabd1006a24804c40aebc (patch)
tree754d9a2d5a663668ea228f4cef541c024baa025a
parent64781857c85c67c24eef122dd537eff5cbc3bfb9 (diff)
downloadmy-keymaps-9aacf90e6c9f0f1f856dabd1006a24804c40aebc.tar.gz
my-keymaps-9aacf90e6c9f0f1f856dabd1006a24804c40aebc.zip
voyager: Add scroll toggle button
Pressing and holding this button will change the mode of the track ball from moving the mouse to scrolling.
-rw-r--r--keyboards/zsa/voyager/keymaps/ryuk/keymap.c16
1 files changed, 15 insertions, 1 deletions
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;
+}