diff options
Diffstat (limited to 'users/peej/peej.c')
-rw-r--r-- | users/peej/peej.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/users/peej/peej.c b/users/peej/peej.c new file mode 100644 index 000000000..c4ea4f87b --- /dev/null +++ b/users/peej/peej.c | |||
@@ -0,0 +1,68 @@ | |||
1 | /* Copyright 2020 Paul James | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #include "peej.h" | ||
18 | |||
19 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
20 | bool is_shifted = get_mods() & MOD_LSFT; | ||
21 | |||
22 | if (record->event.pressed) { | ||
23 | switch(keycode) { | ||
24 | case MC_ARR: | ||
25 | if (is_shifted) { | ||
26 | unregister_mods(MOD_LSFT); | ||
27 | SEND_STRING("=>"); | ||
28 | register_mods(MOD_LSFT); | ||
29 | } else { | ||
30 | SEND_STRING("->"); | ||
31 | } | ||
32 | break; | ||
33 | case MC_DARR: | ||
34 | unregister_mods(MOD_LSFT); | ||
35 | SEND_STRING("=>"); | ||
36 | if (is_shifted) register_mods(MOD_LSFT); | ||
37 | break; | ||
38 | case MC_DEQL: | ||
39 | if (is_shifted) { | ||
40 | unregister_mods(MOD_LSFT); | ||
41 | SEND_STRING("!="); | ||
42 | register_mods(MOD_LSFT); | ||
43 | } else { | ||
44 | SEND_STRING("=="); | ||
45 | } | ||
46 | break; | ||
47 | case MC_TEQL: | ||
48 | if (is_shifted) { | ||
49 | unregister_mods(MOD_LSFT); | ||
50 | SEND_STRING("!=="); | ||
51 | register_mods(MOD_LSFT); | ||
52 | } else { | ||
53 | SEND_STRING("==="); | ||
54 | } | ||
55 | break; | ||
56 | case KC_RESET: | ||
57 | #ifdef RGBLIGHT_ENABLE | ||
58 | rgblight_enable_noeeprom(); | ||
59 | rgblight_mode_noeeprom(1); | ||
60 | rgblight_setrgb_red(); | ||
61 | #endif | ||
62 | reset_keyboard(); | ||
63 | break; | ||
64 | } | ||
65 | } | ||
66 | |||
67 | return true; | ||
68 | }; | ||