aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/feature_stenography.md15
-rw-r--r--quantum/keymap_extras/keymap_steno.h18
-rw-r--r--quantum/process_keycode/process_steno.c15
-rw-r--r--quantum/quantum_keycodes.h2
4 files changed, 50 insertions, 0 deletions
diff --git a/docs/feature_stenography.md b/docs/feature_stenography.md
index bf4bd39db..af4754ed7 100644
--- a/docs/feature_stenography.md
+++ b/docs/feature_stenography.md
@@ -128,3 +128,18 @@ As defined in `keymap_steno.h`.
128|`STN_RES1`||(GeminiPR only)| 128|`STN_RES1`||(GeminiPR only)|
129|`STN_RES2`||(GeminiPR only)| 129|`STN_RES2`||(GeminiPR only)|
130|`STN_PWR`||(GeminiPR only)| 130|`STN_PWR`||(GeminiPR only)|
131
132If you do not want to hit two keys with one finger combined keycodes can be used. These are also defined in `keymap_steno.h`, and causes both keys to be reported as pressed or released. To use these keycodes define `STENO_COMBINEDMAP` in your `config.h` file
133|Combined key | Key1 | Key 2 |
134|---------------|--------|----------|
135|STN_S3 | STN_S1 | STN_S2 |
136|STN_TKL | STN_TL | STN_KL |
137|STN_PWL | STN_PL | STN_WL |
138|STN_HRL | STN_HL | STN_RL |
139|STN_FRR | STN_FR | STN_RR |
140|STN_PBR | STN_PR | STN_BR |
141|STN_LGR | STN_LR | STN_GR |
142|STN_TSR | STN_TR | STN_SR |
143|STN_DZR | STN_DR | STN_ZR |
144|STN_AO | STN_A | STN_O |
145|STN_EU | STN_E | STN_U |
diff --git a/quantum/keymap_extras/keymap_steno.h b/quantum/keymap_extras/keymap_steno.h
index b9115fb8b..ab95b43fd 100644
--- a/quantum/keymap_extras/keymap_steno.h
+++ b/quantum/keymap_extras/keymap_steno.h
@@ -72,3 +72,21 @@ enum steno_keycodes {
72 STN_ZR, 72 STN_ZR,
73 STN__MAX = STN_ZR, // must be less than QK_STENO_BOLT 73 STN__MAX = STN_ZR, // must be less than QK_STENO_BOLT
74}; 74};
75
76#ifdef STENO_COMBINEDMAP
77enum steno_combined_keycodes
78{
79 STN_S3 = QK_STENO_COMB,
80 STN_TKL,
81 STN_PWL,
82 STN_HRL,
83 STN_FRR,
84 STN_PBR,
85 STN_LGR,
86 STN_TSR,
87 STN_DZR,
88 STN_AO,
89 STN_EU,
90 STN_COMB_MAX = STN_EU,
91};
92#endif
diff --git a/quantum/process_keycode/process_steno.c b/quantum/process_keycode/process_steno.c
index 57e279f21..a964aead3 100644
--- a/quantum/process_keycode/process_steno.c
+++ b/quantum/process_keycode/process_steno.c
@@ -65,6 +65,12 @@ static steno_mode_t mode;
65 65
66static 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}; 66static 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};
67 67
68#ifdef STENO_COMBINEDMAP
69/* Used to look up when pressing the middle row key to combine two consonant or vowel keys */
70static 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};
71static 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};
72#endif
73
68static void steno_clear_state(void) { 74static void steno_clear_state(void) {
69 memset(state, 0, sizeof(state)); 75 memset(state, 0, sizeof(state));
70 memset(chord, 0, sizeof(chord)); 76 memset(chord, 0, sizeof(chord));
@@ -167,6 +173,15 @@ bool process_steno(uint16_t keycode, keyrecord_t *record) {
167 } 173 }
168 return false; 174 return false;
169 175
176#ifdef STENO_COMBINEDMAP
177 case QK_STENO_COMB ... QK_STENO_COMB_MAX:
178 {
179 uint8_t result;
180 result = process_steno(combinedmap_first[keycode-QK_STENO_COMB], record);
181 result &= process_steno(combinedmap_second[keycode-QK_STENO_COMB], record);
182 return result;
183 }
184#endif
170 case STN__MIN ... STN__MAX: 185 case STN__MIN ... STN__MAX:
171 if (!process_steno_user(keycode, record)) { 186 if (!process_steno_user(keycode, record)) {
172 return false; 187 return false;
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 3d2dbde92..08ed5a490 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -66,6 +66,8 @@ enum quantum_keycodes {
66 QK_STENO = 0x5A00, 66 QK_STENO = 0x5A00,
67 QK_STENO_BOLT = 0x5A30, 67 QK_STENO_BOLT = 0x5A30,
68 QK_STENO_GEMINI = 0x5A31, 68 QK_STENO_GEMINI = 0x5A31,
69 QK_STENO_COMB = 0x5A32,
70 QK_STENO_COMB_MAX = 0x5A3C,
69 QK_STENO_MAX = 0x5A3F, 71 QK_STENO_MAX = 0x5A3F,
70 // 0x5C00 - 0x5FFF are reserved, see below 72 // 0x5C00 - 0x5FFF are reserved, see below
71 QK_MOD_TAP = 0x6000, 73 QK_MOD_TAP = 0x6000,