summaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_steno.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_steno.c')
-rw-r--r--quantum/process_keycode/process_steno.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/quantum/process_keycode/process_steno.c b/quantum/process_keycode/process_steno.c
index 5d0bb313b4..12ee898212 100644
--- a/quantum/process_keycode/process_steno.c
+++ b/quantum/process_keycode/process_steno.c
@@ -102,11 +102,17 @@ void steno_set_mode(steno_mode_t new_mode) {
102/* override to intercept chords right before they get sent. 102/* override to intercept chords right before they get sent.
103 * return zero to suppress normal sending behavior. 103 * return zero to suppress normal sending behavior.
104 */ 104 */
105__attribute__((weak)) bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { return true; } 105__attribute__((weak)) bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) {
106 return true;
107}
106 108
107__attribute__((weak)) bool postprocess_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[6], int8_t pressed) { return true; } 109__attribute__((weak)) bool postprocess_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[6], int8_t pressed) {
110 return true;
111}
108 112
109__attribute__((weak)) bool process_steno_user(uint16_t keycode, keyrecord_t *record) { return true; } 113__attribute__((weak)) bool process_steno_user(uint16_t keycode, keyrecord_t *record) {
114 return true;
115}
110 116
111static void send_steno_chord(void) { 117static void send_steno_chord(void) {
112 if (send_steno_chord_user(mode, chord)) { 118 if (send_steno_chord_user(mode, chord)) {
@@ -114,11 +120,11 @@ static void send_steno_chord(void) {
114 case STENO_MODE_BOLT: 120 case STENO_MODE_BOLT:
115 send_steno_state(BOLT_STATE_SIZE, false); 121 send_steno_state(BOLT_STATE_SIZE, false);
116#ifdef VIRTSER_ENABLE 122#ifdef VIRTSER_ENABLE
117 virtser_send(0); // terminating byte 123 virtser_send(0); // terminating byte
118#endif 124#endif
119 break; 125 break;
120 case STENO_MODE_GEMINI: 126 case STENO_MODE_GEMINI:
121 chord[0] |= 0x80; // Indicate start of packet 127 chord[0] |= 0x80; // Indicate start of packet
122 send_steno_state(GEMINI_STATE_SIZE, true); 128 send_steno_state(GEMINI_STATE_SIZE, true);
123 break; 129 break;
124 } 130 }
@@ -126,9 +132,13 @@ static void send_steno_chord(void) {
126 steno_clear_state(); 132 steno_clear_state();
127} 133}
128 134
129uint8_t *steno_get_state(void) { return &state[0]; } 135uint8_t *steno_get_state(void) {
136 return &state[0];
137}
130 138
131uint8_t *steno_get_chord(void) { return &chord[0]; } 139uint8_t *steno_get_chord(void) {
140 return &chord[0];
141}
132 142
133static bool update_state_bolt(uint8_t key, bool press) { 143static bool update_state_bolt(uint8_t key, bool press) {
134 uint8_t boltcode = pgm_read_byte(boltmap + key); 144 uint8_t boltcode = pgm_read_byte(boltmap + key);