diff options
author | U-LANDSRAAD\drashna <drashna@live.com> | 2017-12-19 10:06:22 -0800 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2017-12-20 14:38:56 -0500 |
commit | a1fa70f94ddddcd6b51914a89cee7218ae1281ce (patch) | |
tree | c9fa1c68954469d9185d8418d0996cd8eb828344 /quantum/process_keycode | |
parent | d8f0faabdad2e2bc80d2258bda80e6b9e9918b63 (diff) | |
download | qmk_firmware-a1fa70f94ddddcd6b51914a89cee7218ae1281ce.tar.gz qmk_firmware-a1fa70f94ddddcd6b51914a89cee7218ae1281ce.zip |
Add toggle option to AutoShift
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r-- | quantum/process_keycode/process_auto_shift.c | 13 |
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; | |||
34 | uint16_t autoshift_timeout = AUTO_SHIFT_TIMEOUT; | 34 | uint16_t autoshift_timeout = AUTO_SHIFT_TIMEOUT; |
35 | uint16_t autoshift_lastkey = KC_NO; | 35 | uint16_t autoshift_lastkey = KC_NO; |
36 | 36 | ||
37 | bool autoshift_enabled = true; | ||
38 | |||
37 | void autoshift_timer_report(void) { | 39 | void autoshift_timer_report(void) { |
38 | char display[8]; | 40 | char display[8]; |
39 | 41 | ||
@@ -84,6 +86,15 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { | |||
84 | autoshift_timer_report(); | 86 | autoshift_timer_report(); |
85 | return false; | 87 | return false; |
86 | 88 | ||
89 | case KC_ASTG: | ||
90 | if (autoshift_enabled) { | ||
91 | autoshift_enabled = false; | ||
92 | autoshift_flush(); | ||
93 | } | ||
94 | else { | ||
95 | autoshift_enabled = true; | ||
96 | } | ||
97 | |||
87 | #ifndef NO_AUTO_SHIFT_ALPHA | 98 | #ifndef NO_AUTO_SHIFT_ALPHA |
88 | case KC_A: | 99 | case KC_A: |
89 | case KC_B: | 100 | case KC_B: |
@@ -137,6 +148,8 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { | |||
137 | case KC_DOT: | 148 | case KC_DOT: |
138 | case KC_SLSH: | 149 | case KC_SLSH: |
139 | #endif | 150 | #endif |
151 | if (!autoshift_enabled) return true; | ||
152 | |||
140 | autoshift_flush(); | 153 | autoshift_flush(); |
141 | 154 | ||
142 | any_mod_pressed = get_mods() & ( | 155 | any_mod_pressed = get_mods() & ( |