1 #include "process_unicode.h"
3 static uint8_t input_mode;
5 uint16_t hex_to_keycode(uint8_t hex)
9 } else if (hex < 0xA) {
10 return KC_1 + (hex - 0x1);
12 return KC_A + (hex - 0xA);
16 void set_unicode_mode(uint8_t os_target)
18 input_mode = os_target;
21 bool process_unicode(uint16_t keycode, keyrecord_t *record) {
22 if (keycode > QK_UNICODE && record->event.pressed) {
23 uint16_t unicode = keycode & 0x7FFF;
26 register_code(KC_LALT);
29 register_code(KC_LCTL);
30 register_code(KC_LSFT);
32 unregister_code(KC_U);
35 register_code(KC_LALT);
36 register_code(KC_PPLS);
37 unregister_code(KC_PPLS);
40 for(int i = 3; i >= 0; i--) {
41 uint8_t digit = ((unicode >> (i*4)) & 0xF);
42 register_code(hex_to_keycode(digit));
43 unregister_code(hex_to_keycode(digit));
48 unregister_code(KC_LALT);
51 unregister_code(KC_LCTL);
52 unregister_code(KC_LSFT);