aboutsummaryrefslogtreecommitdiff
path: root/qmk/keyboards
diff options
context:
space:
mode:
Diffstat (limited to 'qmk/keyboards')
-rw-r--r--qmk/keyboards/sofle_choc/keymaps/custom/shift_dance.c7
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;
}