]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Allow Space Cadet state to be canceled by alternate Shift key
authorSmilliam <smilliam@gmail.com>
Tue, 5 Jul 2016 02:56:08 +0000 (19:56 -0700)
committerSmilliam <smilliam@gmail.com>
Tue, 5 Jul 2016 02:56:08 +0000 (19:56 -0700)
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.

quantum/quantum.c

index d59bd5a3f8503f96df48d0c3f325c789f1beb573..65290338d022ef76107c26978f3d82c0a8dc3378 100644 (file)
@@ -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);