summaryrefslogtreecommitdiff
path: root/quantum/quantum.c
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-06-17 21:42:59 -0400
committerJack Humbert <jack.humb@gmail.com>2016-06-17 21:42:59 -0400
commitb70248fa2144d297504eedbc80a76dfdc40d9f1f (patch)
tree309e513d88c445ccf5a2ba933a31092194609555 /quantum/quantum.c
parentc4ea06d2557ad0611af691fc5082a9ce134f5821 (diff)
downloadqmk_firmware-b70248fa2144d297504eedbc80a76dfdc40d9f1f.tar.gz
qmk_firmware-b70248fa2144d297504eedbc80a76dfdc40d9f1f.zip
addresses #369
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r--quantum/quantum.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index bc63fb614b..0a900aac28 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -70,6 +70,15 @@ uint8_t chord_key_down = 0;
static uint8_t input_mode;
#endif
+// Shift / paren setup
+
+#ifndef LSPO_KEY
+ #define LSPO_KEY KC_9
+#endif
+#ifndef RSPC_KEY
+ #define RSPC_KEY KC_0
+#endif
+
static bool shift_interrupted[2] = {0, 0};
bool keys_chord(uint8_t keys[]) {
@@ -431,18 +440,20 @@ bool process_record_quantum(keyrecord_t *record) {
#endif
+ // Shift / paren setup
+
switch(keycode) {
case KC_LSPO: {
if (record->event.pressed) {
shift_interrupted[0] = false;
- register_mods(MOD_BIT(KC_LSFT));
+ register_mods(MOD_LSFT);
}
else {
if (!shift_interrupted[0]) {
- register_code(KC_9);
- unregister_code(KC_9);
+ register_code(LSPO_KEY);
+ unregister_code(LSPO_KEY);
}
- unregister_mods(MOD_BIT(KC_LSFT));
+ unregister_mods(MOD_LSFT);
}
return false;
break;
@@ -451,14 +462,14 @@ bool process_record_quantum(keyrecord_t *record) {
case KC_RSPC: {
if (record->event.pressed) {
shift_interrupted[1] = false;
- register_mods(MOD_BIT(KC_RSFT));
+ register_mods(MOD_RSFT);
}
else {
if (!shift_interrupted[1]) {
- register_code(KC_0);
- unregister_code(KC_0);
+ register_code(RSPC_KEY);
+ unregister_code(RSPC_KEY);
}
- unregister_mods(MOD_BIT(KC_RSFT));
+ unregister_mods(MOD_RSFT);
}
return false;
break;