summaryrefslogtreecommitdiffstats
path: root/keyboards/keycapsss/kimiko/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/keycapsss/kimiko/keymaps/default/keymap.c')
-rw-r--r--keyboards/keycapsss/kimiko/keymaps/default/keymap.c83
1 files changed, 9 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