diff options
| author | Tobias Schulte <tobias.schulte@gliderpilot.de> | 2019-02-24 04:32:48 +0100 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-02-23 19:32:48 -0800 |
| commit | a69e4406d4ab0a43077bc130dabda536b4fda9ab (patch) | |
| tree | 5912fc68e4a862ec3200300cc2302787b83f87d8 /quantum | |
| parent | 0f62383be57d2e3dacc79a76973295c73e805038 (diff) | |
| download | qmk_firmware-a69e4406d4ab0a43077bc130dabda536b4fda9ab.tar.gz qmk_firmware-a69e4406d4ab0a43077bc130dabda536b4fda9ab.zip | |
Fix Tx Bolt ghosting second character on key press (#5229)
* convert tabs to spaces
* fix #4578: don't call gemini protocol code when in bolt mode
Add missing break; statements in switch. The missing break resulted in
a fall through and an additional processing of the gemini code.
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/process_keycode/process_steno.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/quantum/process_keycode/process_steno.c b/quantum/process_keycode/process_steno.c index 3051fade9..50a1ef2fc 100644 --- a/quantum/process_keycode/process_steno.c +++ b/quantum/process_keycode/process_steno.c | |||
| @@ -114,13 +114,13 @@ static void send_steno_chord(void) { | |||
| 114 | if (send_steno_chord_user(mode, chord)) { | 114 | if (send_steno_chord_user(mode, chord)) { |
| 115 | switch(mode) { | 115 | switch(mode) { |
| 116 | case STENO_MODE_BOLT: | 116 | case STENO_MODE_BOLT: |
| 117 | send_steno_state(BOLT_STATE_SIZE, false); | 117 | send_steno_state(BOLT_STATE_SIZE, false); |
| 118 | virtser_send(0); // terminating byte | 118 | virtser_send(0); // terminating byte |
| 119 | break; | 119 | break; |
| 120 | case STENO_MODE_GEMINI: | 120 | case STENO_MODE_GEMINI: |
| 121 | chord[0] |= 0x80; // Indicate start of packet | 121 | chord[0] |= 0x80; // Indicate start of packet |
| 122 | send_steno_state(GEMINI_STATE_SIZE, true); | 122 | send_steno_state(GEMINI_STATE_SIZE, true); |
| 123 | break; | 123 | break; |
| 124 | } | 124 | } |
| 125 | } | 125 | } |
| 126 | steno_clear_state(); | 126 | steno_clear_state(); |
| @@ -161,7 +161,7 @@ bool process_steno(uint16_t keycode, keyrecord_t *record) { | |||
| 161 | switch (keycode) { | 161 | switch (keycode) { |
| 162 | case QK_STENO_BOLT: | 162 | case QK_STENO_BOLT: |
| 163 | if (!process_steno_user(keycode, record)) { | 163 | if (!process_steno_user(keycode, record)) { |
| 164 | return false; | 164 | return false; |
| 165 | } | 165 | } |
| 166 | if (IS_PRESSED(record->event)) { | 166 | if (IS_PRESSED(record->event)) { |
| 167 | steno_set_mode(STENO_MODE_BOLT); | 167 | steno_set_mode(STENO_MODE_BOLT); |
| @@ -170,7 +170,7 @@ bool process_steno(uint16_t keycode, keyrecord_t *record) { | |||
| 170 | 170 | ||
| 171 | case QK_STENO_GEMINI: | 171 | case QK_STENO_GEMINI: |
| 172 | if (!process_steno_user(keycode, record)) { | 172 | if (!process_steno_user(keycode, record)) { |
| 173 | return false; | 173 | return false; |
| 174 | } | 174 | } |
| 175 | if (IS_PRESSED(record->event)) { | 175 | if (IS_PRESSED(record->event)) { |
| 176 | steno_set_mode(STENO_MODE_GEMINI); | 176 | steno_set_mode(STENO_MODE_GEMINI); |
| @@ -179,25 +179,27 @@ bool process_steno(uint16_t keycode, keyrecord_t *record) { | |||
| 179 | 179 | ||
| 180 | case STN__MIN...STN__MAX: | 180 | case STN__MIN...STN__MAX: |
| 181 | if (!process_steno_user(keycode, record)) { | 181 | if (!process_steno_user(keycode, record)) { |
| 182 | return false; | 182 | return false; |
| 183 | } | 183 | } |
| 184 | switch(mode) { | 184 | switch(mode) { |
| 185 | case STENO_MODE_BOLT: | 185 | case STENO_MODE_BOLT: |
| 186 | update_state_bolt(keycode - QK_STENO, IS_PRESSED(record->event)); | 186 | update_state_bolt(keycode - QK_STENO, IS_PRESSED(record->event)); |
| 187 | case STENO_MODE_GEMINI: | 187 | break; |
| 188 | update_state_gemini(keycode - QK_STENO, IS_PRESSED(record->event)); | 188 | case STENO_MODE_GEMINI: |
| 189 | update_state_gemini(keycode - QK_STENO, IS_PRESSED(record->event)); | ||
| 190 | break; | ||
| 189 | } | 191 | } |
| 190 | // allow postprocessing hooks | 192 | // allow postprocessing hooks |
| 191 | if (postprocess_steno_user(keycode, record, mode, chord, pressed)) { | 193 | if (postprocess_steno_user(keycode, record, mode, chord, pressed)) { |
| 192 | if (IS_PRESSED(record->event)) { | 194 | if (IS_PRESSED(record->event)) { |
| 193 | ++pressed; | 195 | ++pressed; |
| 194 | } else { | 196 | } else { |
| 195 | --pressed; | 197 | --pressed; |
| 196 | if (pressed <= 0) { | 198 | if (pressed <= 0) { |
| 197 | pressed = 0; | 199 | pressed = 0; |
| 198 | send_steno_chord(); | 200 | send_steno_chord(); |
| 199 | } | 201 | } |
| 200 | } | 202 | } |
| 201 | } | 203 | } |
| 202 | return false; | 204 | return false; |
| 203 | } | 205 | } |
