aboutsummaryrefslogtreecommitdiff
path: root/quantum/quantum.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r--quantum/quantum.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 52f19af98..c80975f21 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -162,6 +162,11 @@ void reset_keyboard(void) {
162 #define RSPC_KEY KC_0 162 #define RSPC_KEY KC_0
163#endif 163#endif
164 164
165// Shift / Enter setup
166#ifndef SFTENT_KEY
167 #define SFTENT_KEY KC_ENT
168#endif
169
165static bool shift_interrupted[2] = {0, 0}; 170static bool shift_interrupted[2] = {0, 0};
166static uint16_t scs_timer[2] = {0, 0}; 171static uint16_t scs_timer[2] = {0, 0};
167 172
@@ -552,6 +557,24 @@ bool process_record_quantum(keyrecord_t *record) {
552 } 557 }
553 return false; 558 return false;
554 } 559 }
560
561 case KC_SFTENT: {
562 if (record->event.pressed) {
563 shift_interrupted[1] = false;
564 scs_timer[1] = timer_read ();
565 register_mods(MOD_BIT(KC_RSFT));
566 }
567 else if (!shift_interrupted[1] && timer_elapsed(scs_timer[1]) < TAPPING_TERM) {
568 unregister_mods(MOD_BIT(KC_RSFT));
569 register_code(SFTENT_KEY);
570 unregister_code(SFTENT_KEY);
571 }
572 else {
573 unregister_mods(MOD_BIT(KC_RSFT));
574 }
575 return false;
576 }
577
555 case GRAVE_ESC: { 578 case GRAVE_ESC: {
556 uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT) 579 uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)
557 |MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))); 580 |MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)));