aboutsummaryrefslogtreecommitdiff
path: root/quantum
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
parentc4ea06d2557ad0611af691fc5082a9ce134f5821 (diff)
downloadqmk_firmware-b70248fa2144d297504eedbc80a76dfdc40d9f1f.tar.gz
qmk_firmware-b70248fa2144d297504eedbc80a76dfdc40d9f1f.zip
addresses #369
Diffstat (limited to 'quantum')
-rw-r--r--quantum/quantum.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index bc63fb614..0a900aac2 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -70,6 +70,15 @@ uint8_t chord_key_down = 0;
70 static uint8_t input_mode; 70 static uint8_t input_mode;
71#endif 71#endif
72 72
73// Shift / paren setup
74
75#ifndef LSPO_KEY
76 #define LSPO_KEY KC_9
77#endif
78#ifndef RSPC_KEY
79 #define RSPC_KEY KC_0
80#endif
81
73static bool shift_interrupted[2] = {0, 0}; 82static bool shift_interrupted[2] = {0, 0};
74 83
75bool keys_chord(uint8_t keys[]) { 84bool keys_chord(uint8_t keys[]) {
@@ -431,18 +440,20 @@ bool process_record_quantum(keyrecord_t *record) {
431 440
432#endif 441#endif
433 442
443 // Shift / paren setup
444
434 switch(keycode) { 445 switch(keycode) {
435 case KC_LSPO: { 446 case KC_LSPO: {
436 if (record->event.pressed) { 447 if (record->event.pressed) {
437 shift_interrupted[0] = false; 448 shift_interrupted[0] = false;
438 register_mods(MOD_BIT(KC_LSFT)); 449 register_mods(MOD_LSFT);
439 } 450 }
440 else { 451 else {
441 if (!shift_interrupted[0]) { 452 if (!shift_interrupted[0]) {
442 register_code(KC_9); 453 register_code(LSPO_KEY);
443 unregister_code(KC_9); 454 unregister_code(LSPO_KEY);
444 } 455 }
445 unregister_mods(MOD_BIT(KC_LSFT)); 456 unregister_mods(MOD_LSFT);
446 } 457 }
447 return false; 458 return false;
448 break; 459 break;
@@ -451,14 +462,14 @@ bool process_record_quantum(keyrecord_t *record) {
451 case KC_RSPC: { 462 case KC_RSPC: {
452 if (record->event.pressed) { 463 if (record->event.pressed) {
453 shift_interrupted[1] = false; 464 shift_interrupted[1] = false;
454 register_mods(MOD_BIT(KC_RSFT)); 465 register_mods(MOD_RSFT);
455 } 466 }
456 else { 467 else {
457 if (!shift_interrupted[1]) { 468 if (!shift_interrupted[1]) {
458 register_code(KC_0); 469 register_code(RSPC_KEY);
459 unregister_code(KC_0); 470 unregister_code(RSPC_KEY);
460 } 471 }
461 unregister_mods(MOD_BIT(KC_RSFT)); 472 unregister_mods(MOD_RSFT);
462 } 473 }
463 return false; 474 return false;
464 break; 475 break;