diff options
Diffstat (limited to 'users/moults31/obs.c')
| -rw-r--r-- | users/moults31/obs.c | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/users/moults31/obs.c b/users/moults31/obs.c new file mode 100644 index 000000000..0ae5f3deb --- /dev/null +++ b/users/moults31/obs.c | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | /* Copyright 2021 moults31 | ||
| 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 | #include "obs.h" | ||
| 17 | |||
| 18 | bool process_record_obs(uint16_t keycode, keyrecord_t *record) { | ||
| 19 | // Apply all 4 mods for custom OBS macros | ||
| 20 | register_code(KC_LSHIFT); | ||
| 21 | register_code(KC_LCTL); | ||
| 22 | register_code(KC_LALT); | ||
| 23 | register_code(KC_LGUI); | ||
| 24 | |||
| 25 | switch (keycode) { | ||
| 26 | case M_OBS_BRB: | ||
| 27 | if (record->event.pressed) { | ||
| 28 | SEND_STRING("1"); | ||
| 29 | } | ||
| 30 | break; | ||
| 31 | case M_OBS_GAME: | ||
| 32 | if (record->event.pressed) { | ||
| 33 | SEND_STRING("2"); | ||
| 34 | } | ||
| 35 | break; | ||
| 36 | case M_OBS_JSTCHT: | ||
| 37 | if (record->event.pressed) { | ||
| 38 | SEND_STRING("3"); | ||
| 39 | } | ||
| 40 | break; | ||
| 41 | case M_OBS_DSKT_MUTE: | ||
| 42 | if (record->event.pressed) { | ||
| 43 | SEND_STRING("4"); | ||
| 44 | } | ||
| 45 | break; | ||
| 46 | case M_OBS_DSKT_UNMUTE: | ||
| 47 | if (record->event.pressed) { | ||
| 48 | SEND_STRING("5"); | ||
| 49 | } | ||
| 50 | break; | ||
| 51 | case M_OBS_VOICE_MUTE: | ||
| 52 | if (record->event.pressed) { | ||
| 53 | SEND_STRING("6"); | ||
| 54 | } | ||
| 55 | break; | ||
| 56 | case M_OBS_VOICE_UNMUTE: | ||
| 57 | if (record->event.pressed) { | ||
| 58 | SEND_STRING("7"); | ||
| 59 | } | ||
| 60 | break; | ||
| 61 | case M_OBS_MOOSIC_MUTE: | ||
| 62 | if (record->event.pressed) { | ||
| 63 | SEND_STRING("8"); | ||
| 64 | } | ||
| 65 | break; | ||
| 66 | case M_OBS_MOOSIC_UNMUTE: | ||
| 67 | if (record->event.pressed) { | ||
| 68 | SEND_STRING("9"); | ||
| 69 | } | ||
| 70 | break; | ||
| 71 | } | ||
| 72 | |||
| 73 | // Unpress all 4 mods for custom OBS macros | ||
| 74 | unregister_code(KC_LSHIFT); | ||
| 75 | unregister_code(KC_LCTL); | ||
| 76 | unregister_code(KC_LALT); | ||
| 77 | unregister_code(KC_LGUI); | ||
| 78 | |||
| 79 | return true; | ||
| 80 | } | ||
