aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_unicode.h
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-08-15 12:19:01 -0400
committerGitHub <noreply@github.com>2016-08-15 12:19:01 -0400
commitcc7acfb416d446a123d10d2c33c3344f1f684f1b (patch)
tree5bd1d52f6a727aa4db5eda54979a1621d924ec14 /quantum/process_keycode/process_unicode.h
parentbc8976d27781a45c735eb98d3110e7df6f8a0bad (diff)
parente8845f0daf8dc7a7674dc5420cc5a684bbbea09b (diff)
downloadqmk_firmware-cc7acfb416d446a123d10d2c33c3344f1f684f1b.tar.gz
qmk_firmware-cc7acfb416d446a123d10d2c33c3344f1f684f1b.zip
Merge pull request #635 from algernon/f/ucis
Symbolic Unicode Input System
Diffstat (limited to 'quantum/process_keycode/process_unicode.h')
-rw-r--r--quantum/process_keycode/process_unicode.h38
1 files changed, 37 insertions, 1 deletions
diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h
index ca17f8f66..85364e8eb 100644
--- a/quantum/process_keycode/process_unicode.h
+++ b/quantum/process_keycode/process_unicode.h
@@ -8,10 +8,46 @@
8#define UC_WIN 2 8#define UC_WIN 2
9#define UC_BSD 3 9#define UC_BSD 3
10 10
11#ifndef UNICODE_TYPE_DELAY
12#define UNICODE_TYPE_DELAY 10
13#endif
14
11void set_unicode_input_mode(uint8_t os_target); 15void set_unicode_input_mode(uint8_t os_target);
16void unicode_input_start(void);
17void unicode_input_finish(void);
18void register_hex(uint16_t hex);
12 19
13bool process_unicode(uint16_t keycode, keyrecord_t *record); 20bool process_unicode(uint16_t keycode, keyrecord_t *record);
14 21
22#ifdef UCIS_ENABLE
23#ifndef UCIS_MAX_SYMBOL_LENGTH
24#define UCIS_MAX_SYMBOL_LENGTH 32
25#endif
26
27typedef struct {
28 char *symbol;
29 char *code;
30} qk_ucis_symbol_t;
31
32struct {
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
41extern const qk_ucis_symbol_t ucis_symbol_table[];
42
43void qk_ucis_start(void);
44void qk_ucis_start_user(void);
45void qk_ucis_symbol_fallback (void);
46void register_ucis(const char *hex);
47bool process_ucis (uint16_t keycode, keyrecord_t *record);
48
49#endif
50
15#define UC_BSPC UC(0x0008) 51#define UC_BSPC UC(0x0008)
16 52
17#define UC_SPC UC(0x0020) 53#define UC_SPC UC(0x0020)
@@ -119,4 +155,4 @@ bool process_unicode(uint16_t keycode, keyrecord_t *record);
119#define UC_TILD UC(0x007E) 155#define UC_TILD UC(0x007E)
120#define UC_DEL UC(0x007F) 156#define UC_DEL UC(0x007F)
121 157
122#endif \ No newline at end of file 158#endif