diff options
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/quantum.c | 23 | ||||
| -rw-r--r-- | quantum/quantum_keycodes.h | 3 | 
2 files changed, 26 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 52f19af98e..c80975f21b 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -162,6 +162,11 @@ void reset_keyboard(void) {    #define RSPC_KEY KC_0  #endif +// Shift / Enter setup +#ifndef SFTENT_KEY +  #define SFTENT_KEY KC_ENT +#endif +  static bool shift_interrupted[2] = {0, 0};  static uint16_t scs_timer[2] = {0, 0}; @@ -552,6 +557,24 @@ bool process_record_quantum(keyrecord_t *record) {        }        return false;      } + +    case KC_SFTENT: { +      if (record->event.pressed) { +        shift_interrupted[1] = false; +        scs_timer[1] = timer_read (); +        register_mods(MOD_BIT(KC_RSFT)); +      } +      else if (!shift_interrupted[1] && timer_elapsed(scs_timer[1]) < TAPPING_TERM) { +        unregister_mods(MOD_BIT(KC_RSFT)); +        register_code(SFTENT_KEY); +        unregister_code(SFTENT_KEY); +      } +      else { +        unregister_mods(MOD_BIT(KC_RSFT)); +      } +      return false; +    } +      case GRAVE_ESC: {        uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)                                        |MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))); diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index f2cb257188..453774d85c 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -423,6 +423,9 @@ enum quantum_keycodes {      // Right shift, close paren      KC_RSPC, +    // Shift, Enter +    KC_SFTENT, +      // Printing      PRINT_ON,      PRINT_OFF,  | 
