From 56ecc86482bfc2ff1d4eafea6e0503588f55ff71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jairo=20Ram=C3=ADrez=20=C3=81vila?= <39841786+oriaj3@users.noreply.github.com> Date: Sat, 2 Jul 2022 14:37:29 +0200 Subject: Added oriaj3 keymap with Matrix RGB support for Kimiko keyboard. (#17103) Co-authored-by: Drashna Jaelre --- .../keycapsss/kimiko/keymaps/default/keymap.c | 83 +++------------------- .../keycapsss/kimiko/keymaps/default/rules.mk | 2 + 2 files changed, 11 insertions(+), 74 deletions(-) (limited to 'keyboards/keycapsss/kimiko/keymaps/default') diff --git a/keyboards/keycapsss/kimiko/keymaps/default/keymap.c b/keyboards/keycapsss/kimiko/keymaps/default/keymap.c index 7e767852f6..613041e858 100644 --- a/keyboards/keycapsss/kimiko/keymaps/default/keymap.c +++ b/keyboards/keycapsss/kimiko/keymaps/default/keymap.c @@ -332,78 +332,13 @@ bool oled_task_user(void) { #endif +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_QWERTY] = { ENCODER_CCW_CW(KC_UP, KC_DOWN), ENCODER_CCW_CW(KC_RGHT, KC_LEFT) }, + [_LOWER] = { ENCODER_CCW_CW(KC_TAB, RGB_HUI), ENCODER_CCW_CW(KC_VOLU, KC_VOLD) }, + [_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(RGB_HUI, RGB_HUD) }, +}; +#endif // ENCODER_MAP_ENABLE + -#ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { - // Encoder on master side - if (index == 0) { - switch (get_highest_layer(layer_state)) { - // If the Default (QWERTY) layer is active - case _QWERTY: - // Arrow Up/Down - if (clockwise) { - tap_code(KC_DOWN); - } else { - tap_code(KC_UP); - } - break; - - // If the RAISE layer is active - case _RAISE: - // Switch browser tabs - if (clockwise) { - tap_code16(LCTL(KC_TAB)); - } else { - tap_code16(RCS(KC_TAB)); - } - break; - // If the ADJUST layer is active - case _ADJUST: - // RGB brightness up/down - if (clockwise) { - rgblight_decrease_val(); // tap_code(RGB_VAD); - } else { - rgblight_increase_val(); // tap_code(RGB_VAI); - } - break; - } - } - // Encoder on slave side - else if (index == 1) { - switch (get_highest_layer(layer_state)) { - // If the Default (QWERTY) layer is active - case _QWERTY: - // Scroll by Word - if (clockwise) { - tap_code16(LCTL(KC_RGHT)); - } else { - tap_code16(LCTL(KC_LEFT)); - } - break; - - // If the LOWER layer is active - case _LOWER: - // Volume up/down - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - - // If the ADJUST layer is active - case _ADJUST: - // RGB hue up/down - if (clockwise) { - // tap_code(RGB_HUI); - rgblight_increase_hue(); - } else { - // tap_code(RGB_HUD); - rgblight_decrease_hue(); - } - break; - } - } - return true; -} -#endif // ENCODER_ENABLE diff --git a/keyboards/keycapsss/kimiko/keymaps/default/rules.mk b/keyboards/keycapsss/kimiko/keymaps/default/rules.mk index 5dc0c64072..75655f2bd5 100644 --- a/keyboards/keycapsss/kimiko/keymaps/default/rules.mk +++ b/keyboards/keycapsss/kimiko/keymaps/default/rules.mk @@ -7,3 +7,5 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow # Reduce compiled size, but will automatically disable the legacy TMK Macros and Functions features. # This does not affect QMK Macros and Layers LTO_ENABLE = yes +ENCODER_MAP_ENABLE = yes + -- cgit v1.2.3