diff options
Diffstat (limited to 'users/byungyoonc/byungyoonc.c')
| -rw-r--r-- | users/byungyoonc/byungyoonc.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/users/byungyoonc/byungyoonc.c b/users/byungyoonc/byungyoonc.c new file mode 100644 index 000000000..5059de0d9 --- /dev/null +++ b/users/byungyoonc/byungyoonc.c | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | /* Copyright 2021 Choi Byungyoon <byungyoonc@gmail.com> | ||
| 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 QMK_KEYBOARD_H | ||
| 18 | #include "byungyoonc.h" | ||
| 19 | |||
| 20 | #if (__has_include("secrets.h") && !defined(NO_SECRETS)) | ||
| 21 | # include "secrets.h" | ||
| 22 | #else | ||
| 23 | static const char *const secrets[] = {"test1", "test2"}; | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #if !defined(MACRO_TIMER) | ||
| 27 | # define MACRO_TIMER 20 | ||
| 28 | #endif | ||
| 29 | |||
| 30 | /* replicaJunction's process_record_user_kb */ | ||
| 31 | __attribute__ ((weak)) | ||
| 32 | bool process_record_user_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 33 | return true; | ||
| 34 | } | ||
| 35 | |||
| 36 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 37 | switch (keycode) { | ||
| 38 | case KC_SEC1 ... KC_SEC2: /* Secrets! Externally defined strings, not stored in repo */ | ||
| 39 | if (!record->event.pressed) { | ||
| 40 | clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); | ||
| 41 | send_string_with_delay(secrets[keycode - KC_SEC1], MACRO_TIMER); | ||
| 42 | } | ||
| 43 | return false; | ||
| 44 | break; | ||
| 45 | } | ||
| 46 | return process_record_user_kb(keycode, record); | ||
| 47 | }; | ||
| 48 | |||
