Skip to content

Commit 71d8e72

Browse files
authored
Add 3rd encoder to VIA keymap (qmk#11580)
1 parent c03ad0f commit 71d8e72

File tree

1 file changed

+18
-4
lines changed
  • keyboards/keebio/bdn9/keymaps/via

1 file changed

+18
-4
lines changed

keyboards/keebio/bdn9/keymaps/via/keymap.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#include QMK_KEYBOARD_H
22

3+
enum encoder_names {
4+
_LEFT,
5+
_RIGHT,
6+
_MIDDLE,
7+
};
8+
39
enum layer_names {
410
_ZERO,
511
_ONE,
@@ -36,17 +42,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
3642
};
3743

3844
void encoder_update_user(uint8_t index, bool clockwise) {
39-
if (index == 0) {
45+
if (index == _LEFT) {
4046
if (clockwise) {
4147
tap_code(KC_VOLU);
4248
} else {
4349
tap_code(KC_VOLD);
4450
}
45-
} else if (index == 1) {
51+
}
52+
else if (index == _MIDDLE) {
53+
if (clockwise) {
54+
tap_code(KC_DOWN);
55+
} else {
56+
tap_code(KC_UP);
57+
}
58+
}
59+
else if (index == _RIGHT) {
4660
if (clockwise) {
47-
tap_code(KC_WH_U);
61+
tap_code(KC_PGDN);
4862
} else {
49-
tap_code(KC_WH_D);
63+
tap_code(KC_PGUP);
5064
}
5165
}
5266
}

0 commit comments

Comments
 (0)