aboutsummaryrefslogtreecommitdiff
path: root/users/drashna/keyrecords/unicode.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/drashna/keyrecords/unicode.c')
-rw-r--r--users/drashna/keyrecords/unicode.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c
index 4010b9c1c..db2058e5d 100644
--- a/users/drashna/keyrecords/unicode.c
+++ b/users/drashna/keyrecords/unicode.c
@@ -8,6 +8,11 @@
8 8
9uint16_t typing_mode; 9uint16_t typing_mode;
10 10
11/**
12 * @brief Registers the unicode keystrokes based on desired unicode
13 *
14 * @param glyph Unicode character, supports up to 0x1FFFF (or higher)
15 */
11void tap_unicode_glyph_nomods(uint32_t glyph) { 16void tap_unicode_glyph_nomods(uint32_t glyph) {
12 uint8_t temp_mod = get_mods(); 17 uint8_t temp_mod = get_mods();
13 clear_mods(); 18 clear_mods();
@@ -43,6 +48,15 @@ typedef uint32_t (*translator_function_t)(bool is_shifted, uint32_t keycode);
43 return ret; \ 48 return ret; \
44 } 49 }
45 50
51/**
52 * @brief Handler function for outputting unicode.
53 *
54 * @param keycode Keycode from matrix.
55 * @param record keyrecord_t data structure
56 * @param translator translator lut for different unicode modes
57 * @return true Continue processing matrix press, and send to host
58 * @return false Replace keycode, and do not send to host
59 */
46bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, translator_function_t translator) { 60bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, translator_function_t translator) {
47 uint8_t temp_mod = get_mods(); 61 uint8_t temp_mod = get_mods();
48 uint8_t temp_osm = get_oneshot_mods(); 62 uint8_t temp_osm = get_oneshot_mods();
@@ -182,6 +196,15 @@ bool process_record_zalgo(uint16_t keycode, keyrecord_t *record) {
182 return true; 196 return true;
183} 197}
184 198
199/**
200 * @brief Main handler for unicode input
201 *
202 * @param keycode Keycode from switch matrix
203 * @param record keyrecord_t data struture
204 * @return true Send keycode from matrix to host
205 * @return false Stop processing and do not send to host
206 */
207
185bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { 208bool process_record_unicode(uint16_t keycode, keyrecord_t *record) {
186 switch (keycode) { 209 switch (keycode) {
187 case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ 210 case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻
@@ -265,6 +288,10 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) {
265 return process_unicode_common(keycode, record); 288 return process_unicode_common(keycode, record);
266} 289}
267 290
291/**
292 * @brief Initialize the default unicode mode on firmware startu
293 *
294 */
268void matrix_init_unicode(void) { 295void matrix_init_unicode(void) {
269 unicode_input_mode_init(); 296 unicode_input_mode_init();
270} 297}