1
0
Fork 0

Added oriaj3 keymap with Matrix RGB support for Kimiko keyboard. (#17103)

Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
Jairo Ramírez Ávila 2022-07-02 14:37:29 +02:00 committed by GitHub
parent 627f9321a8
commit 56ecc86482
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 831 additions and 73 deletions

View file

@ -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