diff options
author | MakotoKurauchi <pluis@me.com> | 2023-12-05 17:19:24 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 00:19:24 -0800 |
commit | 65fb7224d5bf33e5f1f9d91c156b196082dc97c3 (patch) | |
tree | 75088f6ffe4de2858823521c80b63c825fbec659 /keyboards/helix/rev3_5rows/keymaps/via | |
parent | 6fb9de6cbbb29a674638f603b7c03b47b4c52130 (diff) |
[Keyboard][Helix] enable encoder map (#22488)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/helix/rev3_5rows/keymaps/via')
-rw-r--r-- | keyboards/helix/rev3_5rows/keymaps/via/keymap.c | 26 | ||||
-rw-r--r-- | keyboards/helix/rev3_5rows/keymaps/via/oled_display.c | 3 | ||||
-rw-r--r-- | keyboards/helix/rev3_5rows/keymaps/via/rules.mk | 1 |
3 files changed, 12 insertions, 18 deletions
diff --git a/keyboards/helix/rev3_5rows/keymaps/via/keymap.c b/keyboards/helix/rev3_5rows/keymaps/via/keymap.c index cc66b90a0d..d832393ccc 100644 --- a/keyboards/helix/rev3_5rows/keymaps/via/keymap.c +++ b/keyboards/helix/rev3_5rows/keymaps/via/keymap.c @@ -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) { diff --git a/keyboards/helix/rev3_5rows/keymaps/via/oled_display.c b/keyboards/helix/rev3_5rows/keymaps/via/oled_display.c index ee5277a7df..3cfb8969f6 100644 --- a/keyboards/helix/rev3_5rows/keymaps/via/oled_display.c +++ b/keyboards/helix/rev3_5rows/keymaps/via/oled_display.c @@ -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); } diff --git a/keyboards/helix/rev3_5rows/keymaps/via/rules.mk b/keyboards/helix/rev3_5rows/keymaps/via/rules.mk index 1e5b99807c..715838ecc5 100644 --- a/keyboards/helix/rev3_5rows/keymaps/via/rules.mk +++ b/keyboards/helix/rev3_5rows/keymaps/via/rules.mk @@ -1 +1,2 @@ +ENCODER_MAP_ENABLE = yes VIA_ENABLE = yes |