[Keymap] Drashna's Defaults cleanup (#13722)
This commit is contained in:
parent
368efb5d2b
commit
eb46c954dc
50 changed files with 986 additions and 1389 deletions
|
@ -29,10 +29,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
// If console is enabled, it will print the matrix position and status of each key pressed
|
||||
#ifdef KEYLOGGER_ENABLE
|
||||
uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count);
|
||||
#endif // KEYLOGGER_ENABLE
|
||||
#endif // KEYLOGGER_ENABLE
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
process_record_user_oled(keycode, record);
|
||||
#endif // OLED
|
||||
#endif // OLED
|
||||
|
||||
if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record)
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
|
@ -46,20 +46,25 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
|
||||
switch (keycode) {
|
||||
case KC_QWERTY ... KC_WORKMAN:
|
||||
case FIRST_DEFAULT_LAYER_KEYCODE ... LAST_DEFAULT_LAYER_KEYCODE:
|
||||
if (record->event.pressed) {
|
||||
uint8_t mods = mod_config(get_mods() | get_oneshot_mods());
|
||||
if (!mods) {
|
||||
set_single_persistent_default_layer(keycode - KC_QWERTY);
|
||||
set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE);
|
||||
#if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3)
|
||||
} else if (mods & MOD_MASK_SHIFT) {
|
||||
set_single_persistent_default_layer(keycode - KC_QWERTY + 4);
|
||||
set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 4);
|
||||
# if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7)
|
||||
|
||||
} else if (mods & MOD_MASK_CTRL) {
|
||||
set_single_persistent_default_layer(keycode - KC_QWERTY + 8);
|
||||
set_single_persistent_default_layer(keycode - FIRST_DEFAULT_LAYER_KEYCODE + 8);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
|
||||
case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
|
||||
if (!record->event.pressed) {
|
||||
#ifndef MAKE_BOOTLOADER
|
||||
uint8_t temp_mod = mod_config(get_mods());
|
||||
|
@ -79,55 +84,63 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
#endif
|
||||
}
|
||||
send_string_with_delay_P(PSTR("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP), TAP_CODE_DELAY);
|
||||
#ifdef RGB_MATRIX_SPLIT_RIGHT
|
||||
send_string_with_delay_P(PSTR(" RGB_MATRIX_SPLIT_RIGHT=yes"), TAP_CODE_DELAY);
|
||||
# ifndef OLED_DRIVER_ENABLE
|
||||
send_string_with_delay_P(PSTR(" OLED_DRIVER_ENABLE=no"), TAP_CODE_DELAY);
|
||||
# endif
|
||||
#ifdef CONVERT_TO_PROTON_C
|
||||
send_string_with_delay_P(PSTR(" -e CTPC=yes"), TAP_CODE_DELAY);
|
||||
#endif
|
||||
send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case VRSN: // Prints firmware version
|
||||
if (record->event.pressed) { send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); }
|
||||
case VRSN: // Prints firmware version
|
||||
if (record->event.pressed) {
|
||||
send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY);
|
||||
}
|
||||
break;
|
||||
|
||||
case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them
|
||||
case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
if (record->event.pressed) {
|
||||
for (uint8_t index = 0; index < 4; index++) { diablo_timer[index].key_interval = 0; }
|
||||
for (uint8_t index = 0; index < 4; index++) {
|
||||
diablo_timer[index].key_interval = 0;
|
||||
}
|
||||
}
|
||||
#endif // TAP_DANCE_ENABLE
|
||||
#endif // TAP_DANCE_ENABLE
|
||||
break;
|
||||
|
||||
case KC_CCCV: // One key copy/paste
|
||||
case KC_CCCV: // One key copy/paste
|
||||
if (record->event.pressed) {
|
||||
copy_paste_timer = timer_read();
|
||||
} else {
|
||||
if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
|
||||
if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
|
||||
tap_code16(LCTL(KC_C));
|
||||
} else { // Tap, paste
|
||||
} else { // Tap, paste
|
||||
tap_code16(LCTL(KC_V));
|
||||
}
|
||||
}
|
||||
break;
|
||||
#ifdef UNICODE_ENABLE
|
||||
case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻
|
||||
if (record->event.pressed) { send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); }
|
||||
case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻
|
||||
if (record->event.pressed) {
|
||||
send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻");
|
||||
}
|
||||
break;
|
||||
case UC_TABL: // ┬─┬ノ( º _ ºノ)
|
||||
if (record->event.pressed) { send_unicode_string("┬─┬ノ( º _ ºノ)"); }
|
||||
case UC_TABL: // ┬─┬ノ( º _ ºノ)
|
||||
if (record->event.pressed) {
|
||||
send_unicode_string("┬─┬ノ( º _ ºノ)");
|
||||
}
|
||||
break;
|
||||
case UC_SHRG: // ¯\_(ツ)_/¯
|
||||
if (record->event.pressed) { send_unicode_string("¯\\_(ツ)_/¯"); }
|
||||
case UC_SHRG: // ¯\_(ツ)_/¯
|
||||
if (record->event.pressed) {
|
||||
send_unicode_string("¯\\_(ツ)_/¯");
|
||||
}
|
||||
break;
|
||||
case UC_DISA: // ಠ_ಠ
|
||||
if (record->event.pressed) { send_unicode_string("ಠ_ಠ"); }
|
||||
case UC_DISA: // ಠ_ಠ
|
||||
if (record->event.pressed) {
|
||||
send_unicode_string("ಠ_ಠ");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal
|
||||
case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal
|
||||
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
if (record->event.pressed) {
|
||||
userspace_config.rgb_layer_change ^= 1;
|
||||
|
@ -137,14 +150,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
|
||||
rgblight_enable_noeeprom();
|
||||
# endif
|
||||
layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better)
|
||||
layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better)
|
||||
# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
|
||||
} else {
|
||||
rgblight_disable_noeeprom();
|
||||
# endif
|
||||
}
|
||||
}
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
break;
|
||||
|
||||
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
|
@ -164,7 +177,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
return false;
|
||||
break;
|
||||
case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions
|
||||
case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions
|
||||
if (record->event.pressed) {
|
||||
bool is_eeprom_updated;
|
||||
# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
|
||||
|
@ -182,7 +195,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
is_eeprom_updated = true;
|
||||
}
|
||||
# endif
|
||||
if (is_eeprom_updated) { eeconfig_update_user(userspace_config.raw); }
|
||||
if (is_eeprom_updated) {
|
||||
eeconfig_update_user(userspace_config.raw);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue