diff options
Diffstat (limited to 'users/drashna/keyrecords/unicode.c')
-rw-r--r-- | users/drashna/keyrecords/unicode.c | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c index 88df2c9df..4010b9c1c 100644 --- a/users/drashna/keyrecords/unicode.c +++ b/users/drashna/keyrecords/unicode.c | |||
@@ -1,34 +1,13 @@ | |||
1 | /* Copyright 2020 @ridingqwerty | 1 | // Copyright 2020 @ridingqwerty |
2 | * Copyright 2020 @tzarc | 2 | // Copyright 2020 @tzarc |
3 | * Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | 3 | // Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> |
4 | * | 4 | // SPDX-License-Identifier: GPL-2.0-or-later |
5 | * This program is free software: you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation, either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | 5 | ||
19 | #include "drashna.h" | 6 | #include "drashna.h" |
20 | #include "process_unicode_common.h" | 7 | #include "process_unicode_common.h" |
21 | 8 | ||
22 | uint16_t typing_mode; | 9 | uint16_t typing_mode; |
23 | 10 | ||
24 | void tap_code16_nomods(uint8_t kc) { | ||
25 | uint8_t temp_mod = get_mods(); | ||
26 | clear_mods(); | ||
27 | clear_oneshot_mods(); | ||
28 | tap_code16(kc); | ||
29 | set_mods(temp_mod); | ||
30 | } | ||
31 | |||
32 | void tap_unicode_glyph_nomods(uint32_t glyph) { | 11 | void tap_unicode_glyph_nomods(uint32_t glyph) { |
33 | uint8_t temp_mod = get_mods(); | 12 | uint8_t temp_mod = get_mods(); |
34 | clear_mods(); | 13 | clear_mods(); |
@@ -188,6 +167,7 @@ bool process_record_aussie(uint16_t keycode, keyrecord_t *record) { | |||
188 | bool process_record_zalgo(uint16_t keycode, keyrecord_t *record) { | 167 | bool process_record_zalgo(uint16_t keycode, keyrecord_t *record) { |
189 | if ((KC_A <= keycode) && (keycode <= KC_0)) { | 168 | if ((KC_A <= keycode) && (keycode <= KC_0)) { |
190 | if (record->event.pressed) { | 169 | if (record->event.pressed) { |
170 | |||
191 | tap_code16_nomods(keycode); | 171 | tap_code16_nomods(keycode); |
192 | 172 | ||
193 | int number = (rand() % (8 + 1 - 2)) + 2; | 173 | int number = (rand() % (8 + 1 - 2)) + 2; |
@@ -247,9 +227,12 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { | |||
247 | } | 227 | } |
248 | } | 228 | } |
249 | break; | 229 | break; |
230 | } | ||
250 | 231 | ||
251 | break; | 232 | if (((get_mods() | get_oneshot_mods()) & ~MOD_MASK_SHIFT) != 0) { |
233 | return true; | ||
252 | } | 234 | } |
235 | |||
253 | if (((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) && record->tap.count) { | 236 | if (((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) && record->tap.count) { |
254 | keycode &= 0xFF; | 237 | keycode &= 0xFF; |
255 | } | 238 | } |