diff options
Diffstat (limited to 'users/drashna/process_records.c')
| -rw-r--r-- | users/drashna/process_records.c | 62 |
1 files changed, 24 insertions, 38 deletions
diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index ef901226e..124354a5b 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c | |||
| @@ -29,10 +29,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 29 | // If console is enabled, it will print the matrix position and status of each key pressed | 29 | // If console is enabled, it will print the matrix position and status of each key pressed |
| 30 | #ifdef KEYLOGGER_ENABLE | 30 | #ifdef KEYLOGGER_ENABLE |
| 31 | 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); | 31 | 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); |
| 32 | #endif // KEYLOGGER_ENABLE | 32 | #endif // KEYLOGGER_ENABLE |
| 33 | #ifdef OLED_DRIVER_ENABLE | 33 | #ifdef OLED_DRIVER_ENABLE |
| 34 | process_record_user_oled(keycode, record); | 34 | process_record_user_oled(keycode, record); |
| 35 | #endif // OLED | 35 | #endif // OLED |
| 36 | 36 | ||
| 37 | if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record) | 37 | if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record) |
| 38 | #ifdef RGB_MATRIX_ENABLE | 38 | #ifdef RGB_MATRIX_ENABLE |
| @@ -59,7 +59,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 59 | } | 59 | } |
| 60 | break; | 60 | break; |
| 61 | 61 | ||
| 62 | case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader | 62 | case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader |
| 63 | if (!record->event.pressed) { | 63 | if (!record->event.pressed) { |
| 64 | #ifndef MAKE_BOOTLOADER | 64 | #ifndef MAKE_BOOTLOADER |
| 65 | uint8_t temp_mod = mod_config(get_mods()); | 65 | uint8_t temp_mod = mod_config(get_mods()); |
| @@ -90,56 +90,44 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 90 | 90 | ||
| 91 | break; | 91 | break; |
| 92 | 92 | ||
| 93 | case VRSN: // Prints firmware version | 93 | case VRSN: // Prints firmware version |
| 94 | if (record->event.pressed) { | 94 | if (record->event.pressed) { send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); } |
| 95 | send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); | ||
| 96 | } | ||
| 97 | break; | 95 | break; |
| 98 | 96 | ||
| 99 | case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them | 97 | case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them |
| 100 | #ifdef TAP_DANCE_ENABLE | 98 | #ifdef TAP_DANCE_ENABLE |
| 101 | if (record->event.pressed) { | 99 | if (record->event.pressed) { |
| 102 | for (uint8_t index = 0; index < 4; index++) { | 100 | for (uint8_t index = 0; index < 4; index++) { diablo_timer[index].key_interval = 0; } |
| 103 | diablo_timer[index].key_interval = 0; | ||
| 104 | } | ||
| 105 | } | 101 | } |
| 106 | #endif // TAP_DANCE_ENABLE | 102 | #endif // TAP_DANCE_ENABLE |
| 107 | break; | 103 | break; |
| 108 | 104 | ||
| 109 | case KC_CCCV: // One key copy/paste | 105 | case KC_CCCV: // One key copy/paste |
| 110 | if (record->event.pressed) { | 106 | if (record->event.pressed) { |
| 111 | copy_paste_timer = timer_read(); | 107 | copy_paste_timer = timer_read(); |
| 112 | } else { | 108 | } else { |
| 113 | if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy | 109 | if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy |
| 114 | tap_code16(LCTL(KC_C)); | 110 | tap_code16(LCTL(KC_C)); |
| 115 | } else { // Tap, paste | 111 | } else { // Tap, paste |
| 116 | tap_code16(LCTL(KC_V)); | 112 | tap_code16(LCTL(KC_V)); |
| 117 | } | 113 | } |
| 118 | } | 114 | } |
| 119 | break; | 115 | break; |
| 120 | #ifdef UNICODE_ENABLE | 116 | #ifdef UNICODE_ENABLE |
| 121 | case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ | 117 | case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ |
| 122 | if (record->event.pressed) { | 118 | if (record->event.pressed) { send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); } |
| 123 | send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); | ||
| 124 | } | ||
| 125 | break; | 119 | break; |
| 126 | case UC_TABL: // ┬─┬ノ( º _ ºノ) | 120 | case UC_TABL: // ┬─┬ノ( º _ ºノ) |
| 127 | if (record->event.pressed) { | 121 | if (record->event.pressed) { send_unicode_string("┬─┬ノ( º _ ºノ)"); } |
| 128 | send_unicode_string("┬─┬ノ( º _ ºノ)"); | ||
| 129 | } | ||
| 130 | break; | 122 | break; |
| 131 | case UC_SHRG: // ¯\_(ツ)_/¯ | 123 | case UC_SHRG: // ¯\_(ツ)_/¯ |
| 132 | if (record->event.pressed) { | 124 | if (record->event.pressed) { send_unicode_string("¯\\_(ツ)_/¯"); } |
| 133 | send_unicode_string("¯\\_(ツ)_/¯"); | ||
| 134 | } | ||
| 135 | break; | 125 | break; |
| 136 | case UC_DISA: // ಠ_ಠ | 126 | case UC_DISA: // ಠ_ಠ |
| 137 | if (record->event.pressed) { | 127 | if (record->event.pressed) { send_unicode_string("ಠ_ಠ"); } |
| 138 | send_unicode_string("ಠ_ಠ"); | ||
| 139 | } | ||
| 140 | break; | 128 | break; |
| 141 | #endif | 129 | #endif |
| 142 | case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal | 130 | case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal |
| 143 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) | 131 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) |
| 144 | if (record->event.pressed) { | 132 | if (record->event.pressed) { |
| 145 | userspace_config.rgb_layer_change ^= 1; | 133 | userspace_config.rgb_layer_change ^= 1; |
| @@ -149,14 +137,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 149 | # if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) | 137 | # if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) |
| 150 | rgblight_enable_noeeprom(); | 138 | rgblight_enable_noeeprom(); |
| 151 | # endif | 139 | # endif |
| 152 | layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) | 140 | layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) |
| 153 | # if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) | 141 | # if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) |
| 154 | } else { | 142 | } else { |
| 155 | rgblight_disable_noeeprom(); | 143 | rgblight_disable_noeeprom(); |
| 156 | # endif | 144 | # endif |
| 157 | } | 145 | } |
| 158 | } | 146 | } |
| 159 | #endif // RGBLIGHT_ENABLE | 147 | #endif // RGBLIGHT_ENABLE |
| 160 | break; | 148 | break; |
| 161 | 149 | ||
| 162 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) | 150 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) |
| @@ -176,7 +164,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 176 | } | 164 | } |
| 177 | return false; | 165 | return false; |
| 178 | break; | 166 | break; |
| 179 | case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions | 167 | case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions |
| 180 | if (record->event.pressed) { | 168 | if (record->event.pressed) { |
| 181 | bool is_eeprom_updated; | 169 | bool is_eeprom_updated; |
| 182 | # if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) | 170 | # if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) |
| @@ -194,9 +182,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 194 | is_eeprom_updated = true; | 182 | is_eeprom_updated = true; |
| 195 | } | 183 | } |
| 196 | # endif | 184 | # endif |
| 197 | if (is_eeprom_updated) { | 185 | if (is_eeprom_updated) { eeconfig_update_user(userspace_config.raw); } |
| 198 | eeconfig_update_user(userspace_config.raw); | ||
| 199 | } | ||
| 200 | } | 186 | } |
| 201 | #endif | 187 | #endif |
| 202 | } | 188 | } |
