]> git.donarmstrong.com Git - qmk_firmware.git/blob - quantum/process_keycode/process_unicode.h
Merge https://github.com/IBNobody/qmk_firmware
[qmk_firmware.git] / quantum / process_keycode / process_unicode.h
1 #ifndef PROCESS_UNICODE_H
2 #define PROCESS_UNICODE_H
3
4 #include "quantum.h"
5
6 #define UC_OSX 0
7 #define UC_LNX 1
8 #define UC_WIN 2
9 #define UC_BSD 3
10
11 #ifndef UNICODE_TYPE_DELAY
12 #define UNICODE_TYPE_DELAY 10
13 #endif
14
15 void set_unicode_input_mode(uint8_t os_target);
16 void unicode_input_start(void);
17 void unicode_input_finish(void);
18 void register_hex(uint16_t hex);
19
20 bool process_unicode(uint16_t keycode, keyrecord_t *record);
21
22 #ifdef UCIS_ENABLE
23 #ifndef UCIS_MAX_SYMBOL_LENGTH
24 #define UCIS_MAX_SYMBOL_LENGTH 32
25 #endif
26
27 typedef struct {
28   char *symbol;
29   char *code;
30 } qk_ucis_symbol_t;
31
32 struct {
33   uint8_t count;
34   uint16_t codes[UCIS_MAX_SYMBOL_LENGTH];
35   bool in_progress:1;
36 } qk_ucis_state;
37
38 #define UCIS_TABLE(...) {__VA_ARGS__, {NULL, NULL}}
39 #define UCIS_SYM(name, code) {name, #code}
40
41 extern const qk_ucis_symbol_t ucis_symbol_table[];
42
43 void qk_ucis_start(void);
44 void qk_ucis_start_user(void);
45 void qk_ucis_symbol_fallback (void);
46 void register_ucis(const char *hex);
47 bool process_ucis (uint16_t keycode, keyrecord_t *record);
48
49 #endif
50
51 #define UC_BSPC UC(0x0008)
52
53 #define UC_SPC  UC(0x0020)
54
55 #define UC_EXLM UC(0x0021)
56 #define UC_DQUT UC(0x0022)
57 #define UC_HASH UC(0x0023)
58 #define UC_DLR  UC(0x0024)
59 #define UC_PERC UC(0x0025)
60 #define UC_AMPR UC(0x0026)
61 #define UC_QUOT UC(0x0027)
62 #define UC_LPRN UC(0x0028)
63 #define UC_RPRN UC(0x0029)
64 #define UC_ASTR UC(0x002A)
65 #define UC_PLUS UC(0x002B)
66 #define UC_COMM UC(0x002C)
67 #define UC_DASH UC(0x002D)
68 #define UC_DOT  UC(0x002E)
69 #define UC_SLSH UC(0x002F)
70
71 #define UC_0    UC(0x0030)
72 #define UC_1    UC(0x0031)
73 #define UC_2    UC(0x0032)
74 #define UC_3    UC(0x0033)
75 #define UC_4    UC(0x0034)
76 #define UC_5    UC(0x0035)
77 #define UC_6    UC(0x0036)
78 #define UC_7    UC(0x0037)
79 #define UC_8    UC(0x0038)
80 #define UC_9    UC(0x0039)
81
82 #define UC_COLN UC(0x003A)
83 #define UC_SCLN UC(0x003B)
84 #define UC_LT   UC(0x003C)
85 #define UC_EQL  UC(0x003D)
86 #define UC_GT   UC(0x003E)
87 #define UC_QUES UC(0x003F)
88 #define UC_AT   UC(0x0040)
89
90 #define UC_A    UC(0x0041)
91 #define UC_B    UC(0x0042)
92 #define UC_C    UC(0x0043)
93 #define UC_D    UC(0x0044)
94 #define UC_E    UC(0x0045)
95 #define UC_F    UC(0x0046)
96 #define UC_G    UC(0x0047)
97 #define UC_H    UC(0x0048)
98 #define UC_I    UC(0x0049)
99 #define UC_J    UC(0x004A)
100 #define UC_K    UC(0x004B)
101 #define UC_L    UC(0x004C)
102 #define UC_M    UC(0x004D)
103 #define UC_N    UC(0x004E)
104 #define UC_O    UC(0x004F)
105 #define UC_P    UC(0x0050)
106 #define UC_Q    UC(0x0051)
107 #define UC_R    UC(0x0052)
108 #define UC_S    UC(0x0053)
109 #define UC_T    UC(0x0054)
110 #define UC_U    UC(0x0055)
111 #define UC_V    UC(0x0056)
112 #define UC_W    UC(0x0057)
113 #define UC_X    UC(0x0058)
114 #define UC_Y    UC(0x0059)
115 #define UC_Z    UC(0x005A)
116
117 #define UC_LBRC UC(0x005B)
118 #define UC_BSLS UC(0x005C)
119 #define UC_RBRC UC(0x005D)
120 #define UC_CIRM UC(0x005E)
121 #define UC_UNDR UC(0x005F)
122
123 #define UC_GRV  UC(0x0060)
124
125 #define UC_a    UC(0x0061)
126 #define UC_b    UC(0x0062)
127 #define UC_c    UC(0x0063)
128 #define UC_d    UC(0x0064)
129 #define UC_e    UC(0x0065)
130 #define UC_f    UC(0x0066)
131 #define UC_g    UC(0x0067)
132 #define UC_h    UC(0x0068)
133 #define UC_i    UC(0x0069)
134 #define UC_j    UC(0x006A)
135 #define UC_k    UC(0x006B)
136 #define UC_l    UC(0x006C)
137 #define UC_m    UC(0x006D)
138 #define UC_n    UC(0x006E)
139 #define UC_o    UC(0x006F)
140 #define UC_p    UC(0x0070)
141 #define UC_q    UC(0x0071)
142 #define UC_r    UC(0x0072)
143 #define UC_s    UC(0x0073)
144 #define UC_t    UC(0x0074)
145 #define UC_u    UC(0x0075)
146 #define UC_v    UC(0x0076)
147 #define UC_w    UC(0x0077)
148 #define UC_x    UC(0x0078)
149 #define UC_y    UC(0x0079)
150 #define UC_z    UC(0x007A)
151
152 #define UC_LCBR UC(0x007B)
153 #define UC_PIPE UC(0x007C)
154 #define UC_RCBR UC(0x007D)
155 #define UC_TILD UC(0x007E)
156 #define UC_DEL  UC(0x007F)
157
158 #endif