]> git.donarmstrong.com Git - qmk_firmware.git/blob - users/d4mation/macros.c
[Keymap] Added userspace for d4mation. Included their keymap for the Atreus62 (#7483)
[qmk_firmware.git] / users / d4mation / macros.c
1 #include "d4mation.h"
2 #include "tap-hold.h"
3 #include "zalgo.h"
4 #include "macros.h"
5
6 bool zalgo_enabled = false;
7
8 bool process_record_user( uint16_t keycode, keyrecord_t *record ) {
9
10   switch ( keycode ) {
11
12     case _GRAVE_ESC:
13
14       /* Send ` on Tap, Esc on Hold */
15       tap_or_hold( record, KC_GRAVE, KC_ESC );
16
17       return false;
18       break;
19
20     case PHPOPEN:
21
22       if ( record->event.pressed ) {
23
24         tap_code16( S( KC_COMMA ) );
25         tap_code16( S( KC_SLASH ) );
26
27         tap_code( KC_P );
28         tap_code( KC_H );
29         tap_code( KC_P );
30
31       }
32
33       return false;
34       break;
35
36     case PHPCLSE:
37
38       if ( record->event.pressed ) {
39         tap_code16( S( KC_SLASH ) );
40         tap_code16( S( KC_DOT ) );
41       }
42
43       return false;
44       break;
45
46     #ifdef UNICODE_ENABLE
47
48       case AMENO:  /* ༼ つ ◕_◕ ༽つ */
49
50         if ( record->event.pressed ) {
51
52           send_unicode_hex_string( "0F3C 0020 3064 0020 25D5 005F 25D5 0020 0F3D 3064" );
53
54         }
55
56         return false;
57         break;
58
59       case MAGIC:  /* (∩ ͡° ͜ʖ ͡°)⊃━☆゚. * */
60
61         if ( record->event.pressed ) {
62
63           send_unicode_hex_string( "0028 2229 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029 2283 2501 2606 FF9F 002E 0020 002A" );
64
65         }
66
67         return false;
68         break;
69
70       case LENNY:  /* ( ͡° ͜ʖ ͡°) */
71
72         if ( record->event.pressed ) {
73
74           send_unicode_hex_string( "0028 0020 0361 00B0 0020 035C 0296 0020 0361 00b0 0029" );
75
76         }
77
78         return false;
79         break;
80
81       case DISFACE:  /* ಠ_ಠ */
82
83         if ( record->event.pressed ) {
84           send_unicode_hex_string( "0CA0 005F 0CA0" );
85         }
86
87         return false;
88         break;
89
90       case TFLIP:  /* (╯°□°)╯ ︵ ┻━┻ */
91
92         if ( record->event.pressed ) {
93
94           send_unicode_hex_string( "0028 256F 00b0 25A1 00B0 0029 256F FE35 253B 2501 253B" );
95
96         }
97
98         return false;
99         break;
100
101       case TPUT:  /* ┬──┬ ノ( ゜-゜ノ) */
102
103         if ( record->event.pressed ) {
104
105           send_unicode_hex_string( "252C 2500 2500 252C 0020 30CE 0028 0020 309C 002D 309C 30CE 0029" );
106
107         }
108
109         return false;
110         break;
111
112       case SHRUG:  /* ¯\_(ツ)_/¯ */
113
114         if ( record->event.pressed ) {
115
116           send_unicode_hex_string( "00AF 005C 005F 0028 30C4 0029 005F 002F 00AF" );
117
118         }
119
120         return false;
121         break;
122
123       case ZALGO:  /* Toggles Zalgo Text mode */
124
125         if ( record->event.pressed ) {
126           zalgo_enabled = ! zalgo_enabled;
127         }
128
129         return false;
130         break;
131
132     #endif
133
134     default:
135
136       #ifdef UNICODE_ENABLE
137
138         if ( zalgo_enabled ) {
139
140           if ( keycode < KC_A || ( keycode > KC_0 && keycode < KC_MINUS ) || keycode > KC_SLASH ) {
141             process_record_keymap( keycode, record );
142             return true;
143           }
144
145           if ( record->event.pressed ) {
146             zalgo_text( keycode );
147           }
148
149           return false;
150         }
151
152       #endif
153
154       break;
155   }
156
157   process_record_keymap( keycode, record );
158   return true;
159
160 };