diff options
Diffstat (limited to 'quantum/process_keycode')
| -rw-r--r-- | quantum/process_keycode/process_auto_shift.c | 20 | ||||
| -rw-r--r-- | quantum/process_keycode/process_auto_shift.h | 1 |
2 files changed, 14 insertions, 7 deletions
diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c index bf359e994..51b0efdb4 100644 --- a/quantum/process_keycode/process_auto_shift.c +++ b/quantum/process_keycode/process_auto_shift.c | |||
| @@ -216,7 +216,18 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { | |||
| 216 | # endif | 216 | # endif |
| 217 | } | 217 | } |
| 218 | } | 218 | } |
| 219 | if (get_auto_shifted_key(keycode, record)) { | ||
| 220 | if (record->event.pressed) { | ||
| 221 | return autoshift_press(keycode, now, record); | ||
| 222 | } else { | ||
| 223 | autoshift_end(keycode, now, false); | ||
| 224 | return false; | ||
| 225 | } | ||
| 226 | } | ||
| 227 | return true; | ||
| 228 | } | ||
| 219 | 229 | ||
| 230 | __attribute__((weak)) bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) { | ||
| 220 | switch (keycode) { | 231 | switch (keycode) { |
| 221 | # ifndef NO_AUTO_SHIFT_ALPHA | 232 | # ifndef NO_AUTO_SHIFT_ALPHA |
| 222 | case KC_A ... KC_Z: | 233 | case KC_A ... KC_Z: |
| @@ -229,14 +240,9 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { | |||
| 229 | case KC_MINUS ... KC_SLASH: | 240 | case KC_MINUS ... KC_SLASH: |
| 230 | case KC_NONUS_BSLASH: | 241 | case KC_NONUS_BSLASH: |
| 231 | # endif | 242 | # endif |
| 232 | if (record->event.pressed) { | 243 | return true; |
| 233 | return autoshift_press(keycode, now, record); | ||
| 234 | } else { | ||
| 235 | autoshift_end(keycode, now, false); | ||
| 236 | return false; | ||
| 237 | } | ||
| 238 | } | 244 | } |
| 239 | return true; | 245 | return false; |
| 240 | } | 246 | } |
| 241 | 247 | ||
| 242 | #endif | 248 | #endif |
diff --git a/quantum/process_keycode/process_auto_shift.h b/quantum/process_keycode/process_auto_shift.h index 5b2718f11..00a9ab036 100644 --- a/quantum/process_keycode/process_auto_shift.h +++ b/quantum/process_keycode/process_auto_shift.h | |||
| @@ -31,3 +31,4 @@ bool get_autoshift_state(void); | |||
| 31 | uint16_t get_autoshift_timeout(void); | 31 | uint16_t get_autoshift_timeout(void); |
| 32 | void set_autoshift_timeout(uint16_t timeout); | 32 | void set_autoshift_timeout(uint16_t timeout); |
| 33 | void autoshift_matrix_scan(void); | 33 | void autoshift_matrix_scan(void); |
| 34 | bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record); | ||
