summaryrefslogtreecommitdiffstats
path: root/keyboards/keycapsss/kimiko/keymaps/default
diff options
context:
space:
mode:
authorJairo Ramírez Ávila <39841786+oriaj3@users.noreply.github.com>2022-07-02 14:37:29 +0200
committerGitHub <noreply@github.com>2022-07-02 22:37:29 +1000
commit56ecc86482bfc2ff1d4eafea6e0503588f55ff71 (patch)
treef58a3938cf2c98c802710a87646cd5b3e12310ef /keyboards/keycapsss/kimiko/keymaps/default
parent627f9321a8f3ab551a96b42f35ff882009123f5b (diff)
Added oriaj3 keymap with Matrix RGB support for Kimiko keyboard. (#17103)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/keycapsss/kimiko/keymaps/default')
-rw-r--r--keyboards/keycapsss/kimiko/keymaps/default/keymap.c83
-rw-r--r--keyboards/keycapsss/kimiko/keymaps/default/rules.mk2
2 files changed, 11 insertions, 74 deletions
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
+