diff options
| author | martinakcsilla <martinakcsilla@users.noreply.github.com> | 2018-10-03 23:38:02 +0200 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2018-10-03 14:38:02 -0700 |
| commit | 0d61e612f063b91568bf8098878051c4ea405ab3 (patch) | |
| tree | ea4730ff36225d7c731c5b329310d253f0f660d4 | |
| parent | ac27b62fa17859b61a5b5f6c26b1e3113f219b39 (diff) | |
| download | qmk_firmware-0d61e612f063b91568bf8098878051c4ea405ab3.tar.gz qmk_firmware-0d61e612f063b91568bf8098878051c4ea405ab3.zip | |
process_ucis: Add a callback for success (#4067)
There is `qk_ucis_symbol_fallback` for the case where symbol lookup
fails, but there wasn't one for the success case. This adds
`qk_ucis_success`, called after successfully finishing the UCIS symbol
input.
Thanks to @drashna for the idea!
Signed-off-by: Csilla Nagyné Martinák <csilla@csillger.hu>
| -rw-r--r-- | quantum/process_keycode/process_ucis.c | 8 | ||||
| -rw-r--r-- | quantum/process_keycode/process_ucis.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_ucis.c b/quantum/process_keycode/process_ucis.c index 86c0937f5..5de2e41fc 100644 --- a/quantum/process_keycode/process_ucis.c +++ b/quantum/process_keycode/process_ucis.c | |||
| @@ -32,6 +32,10 @@ void qk_ucis_start_user(void) { | |||
| 32 | unicode_input_finish(); | 32 | unicode_input_finish(); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | __attribute__((weak)) | ||
| 36 | void qk_ucis_success(uint8_t symbol_index) { | ||
| 37 | } | ||
| 38 | |||
| 35 | static bool is_uni_seq(char *seq) { | 39 | static bool is_uni_seq(char *seq) { |
| 36 | uint8_t i; | 40 | uint8_t i; |
| 37 | 41 | ||
| @@ -142,6 +146,10 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { | |||
| 142 | } | 146 | } |
| 143 | unicode_input_finish(); | 147 | unicode_input_finish(); |
| 144 | 148 | ||
| 149 | if (symbol_found) { | ||
| 150 | qk_ucis_success(i); | ||
| 151 | } | ||
| 152 | |||
| 145 | qk_ucis_state.in_progress = false; | 153 | qk_ucis_state.in_progress = false; |
| 146 | return false; | 154 | return false; |
| 147 | } | 155 | } |
diff --git a/quantum/process_keycode/process_ucis.h b/quantum/process_keycode/process_ucis.h index 3f736a709..d4aa34cde 100644 --- a/quantum/process_keycode/process_ucis.h +++ b/quantum/process_keycode/process_ucis.h | |||
| @@ -45,6 +45,7 @@ extern const qk_ucis_symbol_t ucis_symbol_table[]; | |||
| 45 | void qk_ucis_start(void); | 45 | void qk_ucis_start(void); |
| 46 | void qk_ucis_start_user(void); | 46 | void qk_ucis_start_user(void); |
| 47 | void qk_ucis_symbol_fallback (void); | 47 | void qk_ucis_symbol_fallback (void); |
| 48 | void qk_ucis_success(uint8_t symbol_index); | ||
| 48 | void register_ucis(const char *hex); | 49 | void register_ucis(const char *hex); |
| 49 | bool process_ucis (uint16_t keycode, keyrecord_t *record); | 50 | bool process_ucis (uint16_t keycode, keyrecord_t *record); |
| 50 | 51 | ||
