summaryrefslogtreecommitdiffstats
path: root/quantum/process_keycode
diff options
context:
space:
mode:
authorfreqmod <freqmod@gmail.com>2021-08-17 20:48:00 +0200
committerGitHub <noreply@github.com>2021-08-18 04:48:00 +1000
commit705774f7bfe13face6a276cee276d43411bb1693 (patch)
tree4e6b031309978ffd4e61e0ecd9838eab3599f8c9 /quantum/process_keycode
parent4b96d5876eb01dfd8063949a2e5cb4b70e01786d (diff)
Steno combinedkeys (#12538)
* Add support for steno keys that press adjacent keys simultaniously * Add some docs for steno combined keys
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r--quantum/process_keycode/process_steno.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_steno.c b/quantum/process_keycode/process_steno.c
index 57e279f211..a964aead35 100644
--- a/quantum/process_keycode/process_steno.c
+++ b/quantum/process_keycode/process_steno.c
@@ -65,6 +65,12 @@ static steno_mode_t mode;
static const uint8_t boltmap[64] PROGMEM = {TXB_NUL, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_S_L, TXB_S_L, TXB_T_L, TXB_K_L, TXB_P_L, TXB_W_L, TXB_H_L, TXB_R_L, TXB_A_L, TXB_O_L, TXB_STR, TXB_STR, TXB_NUL, TXB_NUL, TXB_NUL, TXB_STR, TXB_STR, TXB_E_R, TXB_U_R, TXB_F_R, TXB_R_R, TXB_P_R, TXB_B_R, TXB_L_R, TXB_G_R, TXB_T_R, TXB_S_R, TXB_D_R, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_Z_R};
+#ifdef STENO_COMBINEDMAP
+/* Used to look up when pressing the middle row key to combine two consonant or vowel keys */
+static const uint16_t combinedmap_first[] PROGMEM = {STN_S1, STN_TL, STN_PL, STN_HL, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, STN_A, STN_E};
+static const uint16_t combinedmap_second[] PROGMEM = {STN_S2, STN_KL, STN_WL, STN_RL, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, STN_O, STN_U};
+#endif
+
static void steno_clear_state(void) {
memset(state, 0, sizeof(state));
memset(chord, 0, sizeof(chord));
@@ -167,6 +173,15 @@ bool process_steno(uint16_t keycode, keyrecord_t *record) {
}
return false;
+#ifdef STENO_COMBINEDMAP
+ case QK_STENO_COMB ... QK_STENO_COMB_MAX:
+ {
+ uint8_t result;
+ result = process_steno(combinedmap_first[keycode-QK_STENO_COMB], record);
+ result &= process_steno(combinedmap_second[keycode-QK_STENO_COMB], record);
+ return result;
+ }
+#endif
case STN__MIN ... STN__MAX:
if (!process_steno_user(keycode, record)) {
return false;