1
0
Fork 0

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.
This commit is contained in:
Smilliam 2016-07-04 19:56:08 -07:00
parent 94d3159d9d
commit 1412076df6

View 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);