summaryrefslogtreecommitdiffstats
path: root/quantum/process_keycode
diff options
context:
space:
mode:
authorU-LANDSRAAD\drashna <drashna@live.com>2017-12-19 19:06:22 +0100
committerJack Humbert <jack.humb@gmail.com>2017-12-20 20:38:56 +0100
commita1fa70f94ddddcd6b51914a89cee7218ae1281ce (patch)
treec9fa1c68954469d9185d8418d0996cd8eb828344 /quantum/process_keycode
parentd8f0faabdad2e2bc80d2258bda80e6b9e9918b63 (diff)
downloadqmk_firmware-a1fa70f94ddddcd6b51914a89cee7218ae1281ce.tar.gz
qmk_firmware-a1fa70f94ddddcd6b51914a89cee7218ae1281ce.tar.xz
Add toggle option to AutoShift
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r--quantum/process_keycode/process_auto_shift.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c
index d096cde56..e2e6b02e0 100644
--- a/quantum/process_keycode/process_auto_shift.c
+++ b/quantum/process_keycode/process_auto_shift.c
@@ -34,6 +34,8 @@ uint16_t autoshift_time = 0;
uint16_t autoshift_timeout = AUTO_SHIFT_TIMEOUT;
uint16_t autoshift_lastkey = KC_NO;
+bool autoshift_enabled = true;
+
void autoshift_timer_report(void) {
char display[8];
@@ -84,6 +86,15 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) {
autoshift_timer_report();
return false;
+ case KC_ASTG:
+ if (autoshift_enabled) {
+ autoshift_enabled = false;
+ autoshift_flush();
+ }
+ else {
+ autoshift_enabled = true;
+ }
+
#ifndef NO_AUTO_SHIFT_ALPHA
case KC_A:
case KC_B:
@@ -137,6 +148,8 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) {
case KC_DOT:
case KC_SLSH:
#endif
+ if (!autoshift_enabled) return true;
+
autoshift_flush();
any_mod_pressed = get_mods() & (