summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorSmilliam <smilliam@gmail.com>2016-07-05 04:56:08 +0200
committerSmilliam <smilliam@gmail.com>2016-07-05 04:56:08 +0200
commit1412076df68ac00f9a00173977d2826603c12ddf (patch)
tree7aeeffbd8f3fa2a544e3f97bb0c5672b164072f0 /quantum
parent94d3159d9dbdf711b830c6d7c5a53324097be0a5 (diff)
downloadqmk_firmware-1412076df68ac00f9a00173977d2826603c12ddf.tar.gz
qmk_firmware-1412076df68ac00f9a00173977d2826603c12ddf.tar.xz
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')
-rw-r--r--quantum/quantum.c8
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) {
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);