[Keymap] Updates to drashna Keymaps and Userspace (#17543)
This commit is contained in:
@@ -20,8 +20,12 @@ bool host_driver_disabled = false;
|
||||
*
|
||||
* This handles the keycodes at the keymap level, useful for keyboard specific customization
|
||||
*/
|
||||
__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
|
||||
__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; }
|
||||
__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Main user keycode handler
|
||||
@@ -46,10 +50,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
|
||||
#if defined(OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER)
|
||||
process_record_user_oled(keycode, record);
|
||||
#endif // OLED
|
||||
#endif // OLED
|
||||
|
||||
if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record)
|
||||
#ifdef CUSTOM_RGB_MATRIX
|
||||
@@ -90,34 +94,34 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
break;
|
||||
|
||||
case VRSN: // Prints firmware version
|
||||
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;
|
||||
}
|
||||
}
|
||||
#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;
|
||||
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(CUSTOM_RGBLIGHT) || defined(CUSTOM_RGB_MATRIX)
|
||||
if (record->event.pressed) {
|
||||
userspace_config.rgb_layer_change ^= 1;
|
||||
@@ -140,7 +144,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
# endif
|
||||
}
|
||||
}
|
||||
#endif // CUSTOM_RGBLIGHT
|
||||
#endif // CUSTOM_RGBLIGHT
|
||||
break;
|
||||
|
||||
#if defined(CUSTOM_RGBLIGHT) || defined(CUSTOM_RGB_MATRIX)
|
||||
@@ -160,7 +164,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(CUSTOM_RGBLIGHT) && !defined(RGBLIGHT_DISABLE_KEYCODES)
|
||||
@@ -200,9 +204,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
__attribute__((weak)) void post_process_record_keymap(uint16_t keycode, keyrecord_t *record) {}
|
||||
void post_process_record_user(uint16_t keycode, keyrecord_t *record) { post_process_record_keymap(keycode, record); }
|
||||
void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
post_process_record_keymap(keycode, record);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user