mirror of
https://github.com/openstenoproject/qmk
synced 2024-11-11 02:59:09 +00:00
Add toggle option to AutoShift
This commit is contained in:
parent
d8f0faabda
commit
a1fa70f94d
3 changed files with 17 additions and 1 deletions
|
@ -294,7 +294,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO,
|
KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||||
TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO,
|
TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||||
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO,
|
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO,
|
||||||
KC_NO, KC_NO,
|
KC_ASTG, KC_NO,
|
||||||
KC_NO,
|
KC_NO,
|
||||||
KC_PGDOWN, KC_DELETE, KC_ENTER
|
KC_PGDOWN, KC_DELETE, KC_ENTER
|
||||||
),
|
),
|
||||||
|
|
|
@ -34,6 +34,8 @@ uint16_t autoshift_time = 0;
|
||||||
uint16_t autoshift_timeout = AUTO_SHIFT_TIMEOUT;
|
uint16_t autoshift_timeout = AUTO_SHIFT_TIMEOUT;
|
||||||
uint16_t autoshift_lastkey = KC_NO;
|
uint16_t autoshift_lastkey = KC_NO;
|
||||||
|
|
||||||
|
bool autoshift_enabled = true;
|
||||||
|
|
||||||
void autoshift_timer_report(void) {
|
void autoshift_timer_report(void) {
|
||||||
char display[8];
|
char display[8];
|
||||||
|
|
||||||
|
@ -84,6 +86,15 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) {
|
||||||
autoshift_timer_report();
|
autoshift_timer_report();
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
case KC_ASTG:
|
||||||
|
if (autoshift_enabled) {
|
||||||
|
autoshift_enabled = false;
|
||||||
|
autoshift_flush();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
autoshift_enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef NO_AUTO_SHIFT_ALPHA
|
#ifndef NO_AUTO_SHIFT_ALPHA
|
||||||
case KC_A:
|
case KC_A:
|
||||||
case KC_B:
|
case KC_B:
|
||||||
|
@ -137,6 +148,8 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) {
|
||||||
case KC_DOT:
|
case KC_DOT:
|
||||||
case KC_SLSH:
|
case KC_SLSH:
|
||||||
#endif
|
#endif
|
||||||
|
if (!autoshift_enabled) return true;
|
||||||
|
|
||||||
autoshift_flush();
|
autoshift_flush();
|
||||||
|
|
||||||
any_mod_pressed = get_mods() & (
|
any_mod_pressed = get_mods() & (
|
||||||
|
|
|
@ -121,10 +121,13 @@ enum quantum_keycodes {
|
||||||
KC_LEAD,
|
KC_LEAD,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef AUTO_SHIFT_ENABLE
|
||||||
// Auto Shift setup
|
// Auto Shift setup
|
||||||
KC_ASUP,
|
KC_ASUP,
|
||||||
KC_ASDN,
|
KC_ASDN,
|
||||||
KC_ASRP,
|
KC_ASRP,
|
||||||
|
KC_ASTG,
|
||||||
|
#endif // AUTO_SHIFT_ENABLE
|
||||||
|
|
||||||
// Audio on/off/toggle
|
// Audio on/off/toggle
|
||||||
AU_ON,
|
AU_ON,
|
||||||
|
|
Loading…
Reference in a new issue