Formatting

master
Mark 2022-02-06 12:16:11 -08:00
parent 85b356d4a1
commit c746af211f
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 237 additions and 198 deletions

View File

@ -219,7 +219,10 @@ void set_layer_color(int layer) {
}
void rgb_matrix_indicators_user(void) {
if (g_suspend_state || keyboard_config.disable_layer_led) { return; }
if (g_suspend_state || keyboard_config.disable_layer_led) {
return;
}
switch (biton32(layer_state)) {
case 1:
set_layer_color(1);
@ -249,38 +252,43 @@ void rgb_matrix_indicators_user(void) {
set_layer_color(10);
break;
default:
if (rgb_matrix_get_flags() == LED_FLAG_NONE)
if (rgb_matrix_get_flags() == LED_FLAG_NONE) {
rgb_matrix_set_color_all(0, 0, 0);
}
break;
}
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case ST_MACRO_0:
if (record->event.pressed) {
SEND_STRING(SS_LCTL(SS_LGUI(SS_LSFT(SS_TAP(X_R)))));
}
break;
case ST_MACRO_1:
if (record->event.pressed) {
SEND_STRING(SS_LGUI(SS_TAP(X_P)) SS_DELAY(100) SS_TAP(X_Y) SS_DELAY(100) SS_TAP(X_ENTER));
}
break;
case RU_LAYER:
if (record->event.pressed) {
SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_9)))));
layer_move(9);
}
break;
case EN_LAYER:
if (record->event.pressed) {
SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_0)))));
layer_move(0);
}
break;
case RU_SYMBOL:
if (record->event.pressed) {
SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_0)))));
@ -290,23 +298,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
layer_move(9);
}
break;
case RGB_SLD:
if (record->event.pressed) {
rgblight_mode(1);
}
return false;
case HSV_136_138_245:
if (record->event.pressed) {
rgblight_mode(1);
rgblight_sethsv(136,138,245);
}
return false;
case HSV_24_210_255:
if (record->event.pressed) {
rgblight_mode(1);
rgblight_sethsv(24,210,255);
}
return false;
case HSV_0_0_255:
if (record->event.pressed) {
rgblight_mode(1);
@ -329,29 +341,36 @@ uint32_t layer_state_set_user(uint32_t state) {
case 1:
ergodox_right_led_1_on();
break;
case 2:
ergodox_right_led_2_on();
break;
case 3:
ergodox_right_led_3_on();
break;
case 4:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
break;
case 5:
ergodox_right_led_1_on();
ergodox_right_led_3_on();
break;
case 6:
ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
case 7:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
default:
break;
}
@ -378,12 +397,19 @@ uint8_t dance_step(qk_tap_dance_state_t *state);
uint8_t dance_step(qk_tap_dance_state_t *state) {
if (state->count == 1) {
if (state->interrupted || !state->pressed) return SINGLE_TAP;
else return SINGLE_HOLD;
if (state->interrupted || !state->pressed) {
return SINGLE_TAP;
} else {
return SINGLE_HOLD;
}
} else if (state->count == 2) {
if (state->interrupted) return DOUBLE_SINGLE_TAP;
else if (state->pressed) return DOUBLE_HOLD;
else return DOUBLE_TAP;
if (state->interrupted) {
return DOUBLE_SINGLE_TAP;
} else if (state->pressed) {
return DOUBLE_HOLD;
} else {
return DOUBLE_TAP;
}
}
return MORE_TAPS;
}
@ -407,18 +433,31 @@ void on_dance_0(qk_tap_dance_state_t *state, void *user_data) {
void dance_0_finished(qk_tap_dance_state_t *state, void *user_data) {
dance_state[0].step = dance_step(state);
switch (dance_state[0].step) {
case SINGLE_TAP: register_code16(LGUI(KC_L)); break;
case DOUBLE_TAP: register_code16(LGUI(KC_K)); break;
case DOUBLE_SINGLE_TAP: tap_code16(LGUI(KC_L)); register_code16(LGUI(KC_L));
case SINGLE_TAP:
register_code16(LGUI(KC_L));
break;
case DOUBLE_TAP:
register_code16(LGUI(KC_K));
break;
case DOUBLE_SINGLE_TAP:
tap_code16(LGUI(KC_L));
register_code16(LGUI(KC_L));
break;
}
}
void dance_0_reset(qk_tap_dance_state_t *state, void *user_data) {
wait_ms(10);
switch (dance_state[0].step) {
case SINGLE_TAP: unregister_code16(LGUI(KC_L)); break;
case DOUBLE_TAP: unregister_code16(LGUI(KC_K)); break;
case DOUBLE_SINGLE_TAP: unregister_code16(LGUI(KC_L)); break;
case SINGLE_TAP:
unregister_code16(LGUI(KC_L));
break;
case DOUBLE_TAP:
unregister_code16(LGUI(KC_K));
break;
case DOUBLE_SINGLE_TAP:
unregister_code16(LGUI(KC_L));
break;
}
dance_state[0].step = 0;
}