summaryrefslogtreecommitdiff
path: root/quantum/process_keycode
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-10-27 06:14:56 +1100
committerGitHub <noreply@github.com>2020-10-27 06:14:56 +1100
commit2c92ee1f56b92b15403b2f070c827162db37c9ba (patch)
tree72aba98d58b032f16eca7c49b248a950fb9a9d16 /quantum/process_keycode
parent0c42f91f4ccf98a37f055afb777ed491da56335e (diff)
Allow modified keycodes in Unicode input (#10658)
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r--quantum/process_keycode/process_unicode_common.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c
index 84c44d9874..80be316232 100644
--- a/quantum/process_keycode/process_unicode_common.c
+++ b/quantum/process_keycode/process_unicode_common.c
@@ -136,20 +136,10 @@ __attribute__((weak)) void unicode_input_cancel(void) {
set_mods(unicode_saved_mods); // Reregister previously set mods
}
-__attribute__((weak)) uint16_t hex_to_keycode(uint8_t hex) {
- if (hex == 0x0) {
- return KC_0;
- } else if (hex < 0xA) {
- return KC_1 + (hex - 0x1);
- } else {
- return KC_A + (hex - 0xA);
- }
-}
-
void register_hex(uint16_t hex) {
for (int i = 3; i >= 0; i--) {
uint8_t digit = ((hex >> (i * 4)) & 0xF);
- tap_code(hex_to_keycode(digit));
+ tap_code16(hex_to_keycode(digit));
}
}
@@ -162,10 +152,10 @@ void register_hex32(uint32_t hex) {
uint8_t digit = ((hex >> (i * 4)) & 0xF);
if (digit == 0) {
if (!onzerostart) {
- tap_code(hex_to_keycode(digit));
+ tap_code16(hex_to_keycode(digit));
}
} else {
- tap_code(hex_to_keycode(digit));
+ tap_code16(hex_to_keycode(digit));
onzerostart = false;
}
}