aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/ergodox_ez/keymaps/drashna/keymap.c2
-rw-r--r--quantum/process_keycode/process_auto_shift.c13
-rw-r--r--quantum/quantum_keycodes.h3
3 files changed, 17 insertions, 1 deletions
diff --git a/keyboards/ergodox_ez/keymaps/drashna/keymap.c b/keyboards/ergodox_ez/keymaps/drashna/keymap.c
index 8743ae282..81231242d 100644
--- a/keyboards/ergodox_ez/keymaps/drashna/keymap.c
+++ b/keyboards/ergodox_ez/keymaps/drashna/keymap.c
@@ -294,7 +294,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
294 KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, 294 KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO,
295 TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, 295 TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO,
296 KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO, 296 KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO,
297 KC_NO, KC_NO, 297 KC_ASTG, KC_NO,
298 KC_NO, 298 KC_NO,
299 KC_PGDOWN, KC_DELETE, KC_ENTER 299 KC_PGDOWN, KC_DELETE, KC_ENTER
300 ), 300 ),
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;
34uint16_t autoshift_timeout = AUTO_SHIFT_TIMEOUT; 34uint16_t autoshift_timeout = AUTO_SHIFT_TIMEOUT;
35uint16_t autoshift_lastkey = KC_NO; 35uint16_t autoshift_lastkey = KC_NO;
36 36
37bool autoshift_enabled = true;
38
37void autoshift_timer_report(void) { 39void 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() & (
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 453774d85..b0e555f2e 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -121,10 +121,13 @@ enum quantum_keycodes {
121 KC_LEAD, 121 KC_LEAD,
122#endif 122#endif
123 123
124#ifdef AUTO_SHIFT_ENABLE
124 // Auto Shift setup 125 // Auto Shift setup
125 KC_ASUP, 126 KC_ASUP,
126 KC_ASDN, 127 KC_ASDN,
127 KC_ASRP, 128 KC_ASRP,
129 KC_ASTG,
130#endif // AUTO_SHIFT_ENABLE
128 131
129 // Audio on/off/toggle 132 // Audio on/off/toggle
130 AU_ON, 133 AU_ON,