From 1412076df68ac00f9a00173977d2826603c12ddf Mon Sep 17 00:00:00 2001 From: Smilliam Date: Mon, 4 Jul 2016 19:56:08 -0700 Subject: 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. --- quantum/quantum.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- cgit v1.2.3 From 6b0c9cc905c0985f96a80306cf5fe0d6724b28fc Mon Sep 17 00:00:00 2001 From: Smilliam Date: Mon, 4 Jul 2016 19:58:26 -0700 Subject: fixed indentation. --- quantum/quantum.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index 65290338d0..71c3c723ba 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -162,10 +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 (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); @@ -182,10 +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 (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); -- cgit v1.2.3 From b12fe6abb25db1feca6a7649097a8d1cb67a063f Mon Sep 17 00:00:00 2001 From: Smilliam Date: Sun, 10 Jul 2016 19:04:01 -0700 Subject: Made rollover behavior for space cadet optional --- keyboards/kc60/Makefile | 4 ++-- keyboards/kc60/config.h | 6 ++++++ quantum/quantum.c | 20 ++++++++++++-------- readme.md | 6 ++++++ 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/keyboards/kc60/Makefile b/keyboards/kc60/Makefile index 9717b519c8..855e81b1cc 100644 --- a/keyboards/kc60/Makefile +++ b/keyboards/kc60/Makefile @@ -53,11 +53,11 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration +COMMAND_ENABLE ?= no # Commands for debug and configuration KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend diff --git a/keyboards/kc60/config.h b/keyboards/kc60/config.h index c4a9b9ff82..a315f688fc 100644 --- a/keyboards/kc60/config.h +++ b/keyboards/kc60/config.h @@ -107,6 +107,12 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +/* Prevent stuck modifiers when switching between FN layers */ +#define PREVENT_STUCK_MODIFIERS + +/* Enable opposite shift key to cancel space cadet state */ +#define DISABLE_SPACE_CADET_ROLLOVER + /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/quantum/quantum.c b/quantum/quantum.c index 71c3c723ba..d91b8f2d06 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -162,10 +162,12 @@ 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; - } + #ifdef DISABLE_SPACE_CADET_ROLLOVER + if (get_mods() & MOD_BIT(KC_RSFT)) { + shift_interrupted[0] = true; + shift_interrupted[1] = true; + } + #endif if (!shift_interrupted[0]) { register_code(LSPO_KEY); unregister_code(LSPO_KEY); @@ -182,10 +184,12 @@ 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; - } + #ifdef DISABLE_SPACE_CADET_ROLLOVER + if (get_mods() & MOD_BIT(KC_LSFT)) { + shift_interrupted[0] = true; + shift_interrupted[1] = true; + } + #endif if (!shift_interrupted[1]) { register_code(RSPC_KEY); unregister_code(RSPC_KEY); diff --git a/readme.md b/readme.md index c24d951d8d..cc36a34ffa 100644 --- a/readme.md +++ b/readme.md @@ -309,6 +309,12 @@ It's defaulted to work on US keyboards, but if your layout uses different keys f #define LSPO_KEY KC_9 #define RSPC_KEY KC_0 +You can also choose between different rollover behaviors of the shift keys by defining: + + #define DISABLE_SPACE_CADET_ROLLOVER + +in your `config.h`. Disabling rollover allows you to use the opposite shift key to cancel the space cadet state in the event of an erroneous press instead of emitting a pair of parentheses when the keys are released. + The only other thing you're going to want to do is create a `Makefile` in your keymap directory and set the following: ``` -- cgit v1.2.3 From 5e58e2281ad872048719b2c142169f3e8103af26 Mon Sep 17 00:00:00 2001 From: Smilliam Date: Sun, 10 Jul 2016 19:10:00 -0700 Subject: amended extraneous file edits --- keyboards/kc60/Makefile | 2 +- keyboards/kc60/config.h | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/keyboards/kc60/Makefile b/keyboards/kc60/Makefile index 855e81b1cc..b00a488b91 100644 --- a/keyboards/kc60/Makefile +++ b/keyboards/kc60/Makefile @@ -57,7 +57,7 @@ BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= no # Commands for debug and configuration +COMMAND_ENABLE ?= yes # Commands for debug and configuration KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend diff --git a/keyboards/kc60/config.h b/keyboards/kc60/config.h index a315f688fc..c4a9b9ff82 100644 --- a/keyboards/kc60/config.h +++ b/keyboards/kc60/config.h @@ -107,12 +107,6 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* Prevent stuck modifiers when switching between FN layers */ -#define PREVENT_STUCK_MODIFIERS - -/* Enable opposite shift key to cancel space cadet state */ -#define DISABLE_SPACE_CADET_ROLLOVER - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -- cgit v1.2.3