mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-22 19:39:27 +00:00
Add 3rd encoder to VIA keymap (#11580)
This commit is contained in:
parent
c03ad0f802
commit
71d8e72b80
@ -1,5 +1,11 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum encoder_names {
|
||||
_LEFT,
|
||||
_RIGHT,
|
||||
_MIDDLE,
|
||||
};
|
||||
|
||||
enum layer_names {
|
||||
_ZERO,
|
||||
_ONE,
|
||||
@ -36,17 +42,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
};
|
||||
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) {
|
||||
if (index == _LEFT) {
|
||||
if (clockwise) {
|
||||
tap_code(KC_VOLU);
|
||||
} else {
|
||||
tap_code(KC_VOLD);
|
||||
}
|
||||
} else if (index == 1) {
|
||||
}
|
||||
else if (index == _MIDDLE) {
|
||||
if (clockwise) {
|
||||
tap_code(KC_WH_U);
|
||||
tap_code(KC_DOWN);
|
||||
} else {
|
||||
tap_code(KC_WH_D);
|
||||
tap_code(KC_UP);
|
||||
}
|
||||
}
|
||||
else if (index == _RIGHT) {
|
||||
if (clockwise) {
|
||||
tap_code(KC_PGDN);
|
||||
} else {
|
||||
tap_code(KC_PGUP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user