-void send_steno_state(uint8_t size, bool send_empty) {
- for (uint8_t i = 0; i < size; ++i) {
- if (state[i] || send_empty) {
- virtser_send(state[i]);
+/* override to intercept chords right before they get sent.
+ * return zero to suppress normal sending behavior.
+ */
+__attribute__ ((weak))
+bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { return true; }
+
+__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; }
+
+__attribute__ ((weak))
+bool process_steno_user(uint16_t keycode, keyrecord_t *record) { return true; }
+
+static void send_steno_chord(void) {
+ if (send_steno_chord_user(mode, chord)) {
+ switch(mode) {
+ case STENO_MODE_BOLT:
+ send_steno_state(BOLT_STATE_SIZE, false);
+ virtser_send(0); // terminating byte
+ break;
+ case STENO_MODE_GEMINI:
+ chord[0] |= 0x80; // Indicate start of packet
+ send_steno_state(GEMINI_STATE_SIZE, true);
+ break;