diff options
| author | Smilliam <smilliam@gmail.com> | 2016-07-04 19:56:08 -0700 |
|---|---|---|
| committer | Smilliam <smilliam@gmail.com> | 2016-07-04 19:56:08 -0700 |
| commit | 1412076df68ac00f9a00173977d2826603c12ddf (patch) | |
| tree | 7aeeffbd8f3fa2a544e3f97bb0c5672b164072f0 /quantum/quantum.c | |
| parent | 94d3159d9dbdf711b830c6d7c5a53324097be0a5 (diff) | |
| download | qmk_firmware-1412076df68ac00f9a00173977d2826603c12ddf.tar.gz qmk_firmware-1412076df68ac00f9a00173977d2826603c12ddf.zip | |
Allow Space Cadet state to be canceled by alternate Shift key
Allows you to press RSHIFT to cancel the insertion of a "(" when holding down LSHIFT. Alternatively, allows you to press LSHIFT to cancel the insertion of a ")" when holding down RSHIFT. This change enables you to renege from outputting a character should you press a shift key erroneously.
Diffstat (limited to 'quantum/quantum.c')
| -rw-r--r-- | quantum/quantum.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index d59bd5a3f..65290338d 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -162,6 +162,10 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 162 | register_mods(MOD_BIT(KC_LSFT)); | 162 | register_mods(MOD_BIT(KC_LSFT)); |
| 163 | } | 163 | } |
| 164 | else { | 164 | else { |
| 165 | if (get_mods() & MOD_BIT(KC_RSFT)) { | ||
| 166 | shift_interrupted[0] = true; | ||
| 167 | shift_interrupted[1] = true; | ||
| 168 | } | ||
| 165 | if (!shift_interrupted[0]) { | 169 | if (!shift_interrupted[0]) { |
| 166 | register_code(LSPO_KEY); | 170 | register_code(LSPO_KEY); |
| 167 | unregister_code(LSPO_KEY); | 171 | unregister_code(LSPO_KEY); |
| @@ -178,6 +182,10 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 178 | register_mods(MOD_BIT(KC_RSFT)); | 182 | register_mods(MOD_BIT(KC_RSFT)); |
| 179 | } | 183 | } |
| 180 | else { | 184 | else { |
| 185 | if (get_mods() & MOD_BIT(KC_LSFT)) { | ||
| 186 | shift_interrupted[0] = true; | ||
| 187 | shift_interrupted[1] = true; | ||
| 188 | } | ||
| 181 | if (!shift_interrupted[1]) { | 189 | if (!shift_interrupted[1]) { |
| 182 | register_code(RSPC_KEY); | 190 | register_code(RSPC_KEY); |
| 183 | unregister_code(RSPC_KEY); | 191 | unregister_code(RSPC_KEY); |
