More spidey3 userspace cleanup (#18049)
This commit is contained in:
parent
ef0c87c976
commit
37a85e1f9b
11 changed files with 56 additions and 69 deletions
|
@ -24,7 +24,7 @@
|
|||
#undef LOCKING_SUPPORT_ENABLE
|
||||
|
||||
#define LAYER_STATE_8BIT
|
||||
#define MAX_LAYER 4
|
||||
#define MAX_LAYER 5
|
||||
|
||||
#undef RGBLIGHT_ANIMATIONS
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
|
|
|
@ -61,11 +61,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
RGB_RMOD, RGB_TOG, RGB_MOD),
|
||||
|
||||
[_FN] = LAYOUT(
|
||||
KC_TRNS, DEBUG, QK_BOOT, KC_TRNS,
|
||||
KC_NO, DEBUG, QK_BOOT, KC_TRNS,
|
||||
KC_NO, KC_NO, EEP_RST, KC_TRNS,
|
||||
KC_NO, KC_NO, KC_NO, KC_TRNS,
|
||||
KC_NO, KC_NO, KC_NO),
|
||||
KC_TRNS, KC_NO, KC_NO),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
|
||||
[_MACRO] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[_NUMPAD] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[_CURSOR] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[_RGB] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI ), ENCODER_CCW_CW(RGB_SAD, RGB_SAI ), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) },
|
||||
[_FN] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
typedef enum layer_ack {
|
||||
|
@ -153,9 +162,22 @@ void spidey_glow(void) {
|
|||
rgblight_sethsv(255, 230, 128);
|
||||
}
|
||||
|
||||
void eeconfig_init_user(void) { spidey_glow(); }
|
||||
void eeconfig_init_user(void) {
|
||||
spidey_glow();
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
dprintf("key event: kc: %02X, col: %02u, row: %02u, pressed: %u mods: %08b "
|
||||
#if !defined(NO_ACTION_ONESHOT)
|
||||
"os: %08b "
|
||||
#endif
|
||||
"weak: %08b\n",
|
||||
keycode, record->event.key.col, record->event.key.row, record->event.pressed, bitrev(get_mods()),
|
||||
#if !defined(NO_ACTION_ONESHOT)
|
||||
bitrev(get_oneshot_mods()),
|
||||
#endif
|
||||
bitrev(get_weak_mods()));
|
||||
|
||||
if (record->event.pressed) {
|
||||
switch (keycode) {
|
||||
// Re-implement this here, but fix the persistence!
|
||||
|
@ -208,39 +230,3 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
}
|
||||
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _RGB:
|
||||
if (index == 0) {
|
||||
if (clockwise) {
|
||||
rgblight_increase_hue();
|
||||
} else {
|
||||
rgblight_decrease_hue();
|
||||
}
|
||||
} else if (index == 1) {
|
||||
if (clockwise) {
|
||||
rgblight_increase_sat();
|
||||
} else {
|
||||
rgblight_decrease_sat();
|
||||
}
|
||||
} else if (index == 2) {
|
||||
if (clockwise) {
|
||||
rgblight_increase_val();
|
||||
} else {
|
||||
rgblight_decrease_val();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (index == 0) {
|
||||
tap_code16(C(S(clockwise ? KC_EQL : KC_MINS)));
|
||||
} else if (index == 1) {
|
||||
tap_code16(C(clockwise ? KC_EQL : KC_MINS));
|
||||
} else if (index == 2) {
|
||||
tap_code(clockwise ? KC_VOLU : KC_VOLD);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
MOUSEKEY_ENABLE = no
|
||||
MIDI_ENABLE = no
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
BOOTMAGIC_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
||||
CONSOLE_ENABLE = yes # Console for debug
|
||||
CONSOLE_ENABLE = yes
|
||||
GRAVE_ESC_ENABLE = no
|
||||
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue