summaryrefslogtreecommitdiffstats
path: root/quantum/quantum.c
diff options
context:
space:
mode:
authorSmilliam <smilliam@gmail.com>2016-07-04 19:56:08 -0700
committerSmilliam <smilliam@gmail.com>2016-07-04 19:56:08 -0700
commit1412076df68ac00f9a00173977d2826603c12ddf (patch)
tree7aeeffbd8f3fa2a544e3f97bb0c5672b164072f0 /quantum/quantum.c
parent94d3159d9dbdf711b830c6d7c5a53324097be0a5 (diff)
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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index d59bd5a3f8..65290338d0 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -162,6 +162,10 @@ bool process_record_quantum(keyrecord_t *record) {
register_mods(MOD_BIT(KC_LSFT));
}
else {
+ if (get_mods() & MOD_BIT(KC_RSFT)) {
+ shift_interrupted[0] = true;
+ shift_interrupted[1] = true;
+ }
if (!shift_interrupted[0]) {
register_code(LSPO_KEY);
unregister_code(LSPO_KEY);
@@ -178,6 +182,10 @@ bool process_record_quantum(keyrecord_t *record) {
register_mods(MOD_BIT(KC_RSFT));
}
else {
+ if (get_mods() & MOD_BIT(KC_LSFT)) {
+ shift_interrupted[0] = true;
+ shift_interrupted[1] = true;
+ }
if (!shift_interrupted[1]) {
register_code(RSPC_KEY);
unregister_code(RSPC_KEY);