mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-05-19 05:45:28 -04:00
[Keyboard][Helix] enable encoder map (#22488)
Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
parent
77a1760eb5
commit
4b66fcb0e1
3 changed files with 12 additions and 18 deletions
|
@ -121,22 +121,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
|
||||
};
|
||||
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) { /* Left side encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_PGDN);
|
||||
} else {
|
||||
tap_code(KC_PGUP);
|
||||
}
|
||||
} else if (index == 1) { /* Right side encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_DOWN);
|
||||
} else {
|
||||
tap_code(KC_UP);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#if defined(ENCODER_MAP_ENABLE)
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
||||
[_QWERTY] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[_LOWER] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_HOME, KC_END) },
|
||||
[_RAISE] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) },
|
||||
[_ADJUST] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) },
|
||||
};
|
||||
#endif
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
|
|
|
@ -62,7 +62,7 @@ void render_status(void) {
|
|||
break;
|
||||
default:
|
||||
// Or use the write_ln shortcut over adding '\n' to the end of your string
|
||||
oled_write_ln_P(PSTR("Undefined"), false);
|
||||
oled_write_ln_P(PSTR("N/A"), false);
|
||||
}
|
||||
|
||||
oled_write_P(PSTR("\n"), false);
|
||||
|
@ -71,7 +71,6 @@ void render_status(void) {
|
|||
led_t led_state = host_keyboard_led_state();
|
||||
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
|
||||
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
|
||||
oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
ENCODER_MAP_ENABLE = yes
|
||||
VIA_ENABLE = yes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue