aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_unicode.c
diff options
context:
space:
mode:
authornielsenz <nielsen.zac@gmail.com>2017-03-30 19:15:43 -0700
committernielsenz <nielsen.zac@gmail.com>2017-03-30 19:15:43 -0700
commit7e54332890f4c376314f942574c6183c87a6e9c8 (patch)
tree1332d84f9c7f8bda515ad26af22601b8273cbbfc /quantum/process_keycode/process_unicode.c
parentb9225a28f253e1ec33b8c96798bfef4b8cc0918d (diff)
downloadqmk_firmware-7e54332890f4c376314f942574c6183c87a6e9c8.tar.gz
qmk_firmware-7e54332890f4c376314f942574c6183c87a6e9c8.zip
Pulling and pushing troubles
Diffstat (limited to 'quantum/process_keycode/process_unicode.c')
-rw-r--r--quantum/process_keycode/process_unicode.c75
1 files changed, 0 insertions, 75 deletions
diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c
index cecfaeee9..1f16b9bdb 100644
--- a/quantum/process_keycode/process_unicode.c
+++ b/quantum/process_keycode/process_unicode.c
@@ -16,81 +16,6 @@
16#include "process_unicode.h" 16#include "process_unicode.h"
17#include "action_util.h" 17#include "action_util.h"
18 18
19static uint8_t input_mode;
20static uint8_t first_flag = 0;
21
22__attribute__((weak))
23uint16_t hex_to_keycode(uint8_t hex)
24{
25 if (hex == 0x0) {
26 return KC_0;
27 } else if (hex < 0xA) {
28 return KC_1 + (hex - 0x1);
29 } else {
30 return KC_A + (hex - 0xA);
31 }
32}
33
34void set_unicode_input_mode(uint8_t os_target)
35{
36 input_mode = os_target;
37 eeprom_update_byte(EECONFIG_UNICODEMODE, os_target);
38}
39
40uint8_t get_unicode_input_mode(void) {
41 return input_mode;
42}
43
44__attribute__((weak))
45void unicode_input_start (void) {
46 switch(input_mode) {
47 case UC_OSX:
48 register_code(KC_LALT);
49 break;
50 case UC_LNX:
51 register_code(KC_LCTL);
52 register_code(KC_LSFT);
53 register_code(KC_U);
54 unregister_code(KC_U);
55 unregister_code(KC_LSFT);
56 unregister_code(KC_LCTL);
57 break;
58 case UC_WIN:
59 register_code(KC_LALT);
60 register_code(KC_PPLS);
61 unregister_code(KC_PPLS);
62 break;
63 case UC_WINC:
64 register_code(KC_RALT);
65 unregister_code(KC_RALT);
66 register_code(KC_U);
67 unregister_code(KC_U);
68 }
69 wait_ms(UNICODE_TYPE_DELAY);
70}
71
72__attribute__((weak))
73void unicode_input_finish (void) {
74 switch(input_mode) {
75 case UC_OSX:
76 case UC_WIN:
77 unregister_code(KC_LALT);
78 break;
79 case UC_LNX:
80 register_code(KC_SPC);
81 unregister_code(KC_SPC);
82 break;
83 }
84}
85
86void register_hex(uint16_t hex) {
87 for(int i = 3; i >= 0; i--) {
88 uint8_t digit = ((hex >> (i*4)) & 0xF);
89 register_code(hex_to_keycode(digit));
90 unregister_code(hex_to_keycode(digit));
91 }
92}
93
94 19
95bool process_unicode(uint16_t keycode, keyrecord_t *record) { 20bool process_unicode(uint16_t keycode, keyrecord_t *record) {
96 if (keycode > QK_UNICODE && record->event.pressed) { 21 if (keycode > QK_UNICODE && record->event.pressed) {