aboutsummaryrefslogtreecommitdiff
path: root/users/curry/process_records.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/curry/process_records.c')
-rw-r--r--users/curry/process_records.c85
1 files changed, 85 insertions, 0 deletions
diff --git a/users/curry/process_records.c b/users/curry/process_records.c
new file mode 100644
index 000000000..fd1d61ad9
--- /dev/null
+++ b/users/curry/process_records.c
@@ -0,0 +1,85 @@
1#include "curry.h"
2
3uint16_t copy_paste_timer;
4
5__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
6
7__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; }
8
9bool process_record_user(uint16_t keycode, keyrecord_t *record) {
10 xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
11 switch (keycode) {
12 case KC_MAKE:
13 if (!record->event.pressed) {
14 uint8_t temp_mod = mod_config(get_mods());
15 uint8_t temp_osm = mod_config(get_oneshot_mods());
16 clear_mods();
17 clear_oneshot_mods();
18 send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY);
19 if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) {
20 send_string_with_delay_P(PSTR(":flash"), TAP_CODE_DELAY);
21 }
22 if ((temp_mod | temp_osm) & MOD_MASK_CTRL) {
23 send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY);
24 }
25#ifdef RGB_MATRIX_SPLIT_RIGHT
26 send_string_with_delay_P(PSTR(" RGB_MATRIX_SPLIT_RIGHT=yes"), TAP_CODE_DELAY);
27# ifndef OLED_DRIVER_ENABLE
28 send_string_with_delay_P(PSTR(" OLED_DRIVER_ENABLE=no"), TAP_CODE_DELAY);
29# endif
30#endif
31 send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY);
32 }
33
34 break;
35
36 case VRSN: // Prints firmware version
37 if (record->event.pressed) {
38 send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY);
39 }
40 break;
41
42 case KC_CCCV: // One key copy/paste
43 if (record->event.pressed) {
44 copy_paste_timer = timer_read();
45 } else {
46 if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
47 register_code(KC_LCTL);
48 tap_code(KC_C);
49 unregister_code(KC_LCTL);
50 } else { // Tap, paste
51 register_code(KC_LCTL);
52 tap_code(KC_V);
53 unregister_code(KC_LCTL);
54 }
55 }
56 break;
57#ifdef UNICODE_ENABLE
58 case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻
59 if (record->event.pressed) {
60 send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B");
61 }
62 break;
63 case UC_TABL: // ┬─┬ノ( º _ ºノ)
64 if (record->event.pressed) {
65 send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029");
66 }
67 break;
68 case UC_SHRG: // ¯\_(ツ)_/¯
69 if (record->event.pressed) {
70 send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
71 }
72 break;
73 case UC_DISA: // ಠ_ಠ
74 if (record->event.pressed) {
75 send_unicode_hex_string("0CA0 005F 0CA0");
76 }
77 break;
78#endif
79 }
80 return process_record_keymap(keycode, record) &&
81#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
82 process_record_user_rgb(keycode, record) &&
83#endif // RGBLIGHT_ENABLE
84 process_record_secrets(keycode, record);
85}