Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Mod-tap keys on momentary layers don't work as expected #17281

Closed
fxkuehl opened this issue Jun 1, 2022 · 2 comments
Closed

[Bug] Mod-tap keys on momentary layers don't work as expected #17281

fxkuehl opened this issue Jun 1, 2022 · 2 comments

Comments

@fxkuehl
Copy link
Contributor

fxkuehl commented Jun 1, 2022

Describe the Bug

My keymap uses layers with LT(layer, key) keys, but this issue also applies to MO(layer) layer keys. When I quickly press a "normal" key on a layer, it does not matter whether I release the LT key or the other key first. I get the key from the layer, not the key from the base layer.

If I do the same thing with an MT(mod, key) on the layer and release the layer key first, I get the key from the base layer instead, because the tap of the MT key is only processed when I release the MT key. By that time the layer state already switched back to the base layer.

This problem affects layers, but not modifiers. For example using Shift with a MT(mod, key), and releasing Shift first still gives me the shifted key. The release of the modifiers is delayed until the end of tapping the MT key.

It would be more intuitive if layers and modifiers had the same, consistent behaviour with respect to how they affect MT keys.

System Information

Keyboard: Keebio Iris
Revision (if applicable): rev4
Operating system: Linux
qmk doctor output:

Ψ QMK Doctor is checking your environment.
Ψ CLI version: 1.0.0
Ψ QMK home: /home/felix/src/qmk_firmware
Ψ Detected Linux.
Ψ Git branch: kolibri
Ψ Repo version: 0.16.9
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 9.2.1
Ψ Found avr-gcc version 5.4.0
Ψ Found avrdude version 6.3-20171130
Ψ Found dfu-util version 0.9
Ψ Found dfu-programmer version 0.6.1
Ψ Submodules are up to date.
Ψ QMK is ready to go

Additional Context

I have a patch that implements the desired behaviour that I would be happy to contribute.

@bschwehn
Copy link

bschwehn commented Jun 4, 2022

that is brilliant, I was bothered by an inconsistent behaviour between MT and LT keys for a while and started debugging yesterday, initially thinking that achordion was causing the issue (getreuer/qmk-keymap#13).

Applying this patch fixes my issue, at least in an initial test.
Thank you so much, this made my day!

fxkuehl added a commit to fxkuehl/qmk_firmware that referenced this issue Aug 21, 2022
This allows mod-tap and layer-tap keys on layers to behave as expected.

Bug: qmk#17281
Signed-off-by: Felix Kuehling <[email protected]>
KarlK90 pushed a commit to KarlK90/qmk_firmware that referenced this issue Oct 5, 2022
This allows mod-tap and layer-tap keys on layers to behave as expected.

Bug: qmk#17281
Signed-off-by: Felix Kuehling <[email protected]>
fxkuehl added a commit to fxkuehl/qmk_firmware that referenced this issue Oct 26, 2022
This allows mod-tap and layer-tap keys on layers to behave as expected.

Bug: qmk#17281
Signed-off-by: Felix Kuehling <[email protected]>
KarlK90 pushed a commit that referenced this issue Nov 28, 2022
* Make process_tapping more readable

Move most #ifdefs into conditionally defined macros to make the logic
easier to follow.

* Retain momentary layers until the end of tapping

This allows mod-tap and layer-tap keys on layers to behave as expected.

Bug: #17281

* Add tests for delayed mod/layer release while tapping

Mods and layer key release is delayed while tapping is in progress to
ensure that the tap is registered with the modifier state and on the
layer where the key was first pressed.

Signed-off-by: Felix Kuehling <[email protected]>
@KarlK90
Copy link
Member

KarlK90 commented Nov 28, 2022

With the merge of #17282 this issue is fixed. Thanks again @fxkuehl

@KarlK90 KarlK90 closed this as completed Nov 28, 2022
elpekenin pushed a commit to elpekenin/qmk_firmware that referenced this issue Dec 7, 2022
* Make process_tapping more readable

Move most #ifdefs into conditionally defined macros to make the logic
easier to follow.

* Retain momentary layers until the end of tapping

This allows mod-tap and layer-tap keys on layers to behave as expected.

Bug: qmk#17281

* Add tests for delayed mod/layer release while tapping

Mods and layer key release is delayed while tapping is in progress to
ensure that the tap is registered with the modifier state and on the
layer where the key was first pressed.

Signed-off-by: Felix Kuehling <[email protected]>
omikronik pushed a commit to omikronik/qmk_firmware that referenced this issue Jan 22, 2023
* Make process_tapping more readable

Move most #ifdefs into conditionally defined macros to make the logic
easier to follow.

* Retain momentary layers until the end of tapping

This allows mod-tap and layer-tap keys on layers to behave as expected.

Bug: qmk#17281

* Add tests for delayed mod/layer release while tapping

Mods and layer key release is delayed while tapping is in progress to
ensure that the tap is registered with the modifier state and on the
layer where the key was first pressed.

Signed-off-by: Felix Kuehling <[email protected]>
fxkuehl added a commit to fxkuehl/qmk_firmware that referenced this issue Mar 20, 2023
* Make process_tapping more readable

Move most #ifdefs into conditionally defined macros to make the logic
easier to follow.

* Retain momentary layers until the end of tapping

This allows mod-tap and layer-tap keys on layers to behave as expected.

Bug: qmk#17281

* Add tests for delayed mod/layer release while tapping

Mods and layer key release is delayed while tapping is in progress to
ensure that the tap is registered with the modifier state and on the
layer where the key was first pressed.

Signed-off-by: Felix Kuehling <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants