diff options
| author | Sébastien Dailly <sebastien@dailly.me> | 2026-03-28 21:17:28 +0100 |
|---|---|---|
| committer | Sébastien Dailly <sebastien@dailly.me> | 2026-03-28 21:17:28 +0100 |
| commit | cdb7c08329a6b785ff5d93a627b631d9188c886c (patch) | |
| tree | 7dbbf5f165dcd574e13ea41586c6e168aa9cc903 /qmk/keyboards | |
| parent | 815174b171625d427e1d646933100e380e256057 (diff) | |
Better way to get out the caps lock mode
Diffstat (limited to 'qmk/keyboards')
| -rw-r--r-- | qmk/keyboards/sofle_choc/keymaps/custom/shift_dance.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/qmk/keyboards/sofle_choc/keymaps/custom/shift_dance.c b/qmk/keyboards/sofle_choc/keymaps/custom/shift_dance.c index ba2c9b5..3f779eb 100644 --- a/qmk/keyboards/sofle_choc/keymaps/custom/shift_dance.c +++ b/qmk/keyboards/sofle_choc/keymaps/custom/shift_dance.c @@ -25,7 +25,8 @@ static bool lshift_interrupted = 0; void shift_dance_process_record(uint16_t keycode, keyrecord_t *record) { if (right_shift_tap_state.state == TD_SINGLE_HOLD && record->event.pressed) { // If there is any key pressed while holding the key, do not switch - // in caps lock mod on release. + // in caps lock mod on release. If the key is pressed at the same time, + // the mode will not remain once the key will be released. inhibit_mod = 1; } switch (keycode) { @@ -76,6 +77,10 @@ void right_shift_released(tap_dance_state_t *state, void *user_data) { // The key was released before the timeout, and no other key were // pressed during this time tap_code16(KC_CAPS_LOCK); + else if (inhibit_mod && host_keyboard_led_state().caps_lock) + // Remove the caps lock mode if the mode is active and not supposed to. + tap_code16(KC_CAPS_LOCK); + inhibit_mod = 0; } |
