-
-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
Bug17281 - Retain momentary layers until the end of tapping #17282
Conversation
If possible, it would be very helpful to add unit tests to ensure that the correct behavior is being triggered, and to ensure that it's not broken in the future. |
Sounds reasonable. I have no idea how to write or run unit tests for QMK. I'm still pretty new to it. I'll start reading the docs at https://docs.qmk.fm/#/unit_testing. Edit: At least it looks like I haven't broken any existing unit tests, so that's a good start. ;) |
well, if you take a look at the secure tests and the caps word tests, that may give you a good idea, on how to start. It's not too different from a keymap, but with some of the special stuff due to the testing code. You can use stuff like If you need further help, the discord would be a good place to discuss it. |
Since your change affects the tap-hold logic, you might be also interested in taking a look at the tap-hold unit tests I wrote for #15741, especially the test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review of "Make process_tapping more readable"
Thanks. I was looking for a good place to add my test. It's not really specific to any of the tap_hold_configurations. I deliberately broke the retaining of modifiers during tapping, to see if it would break an existing test similar to what I was doing with layers. But no tests broke. So I ended up adding two tests to tests/basic/test_tapping.cpp. One for releasing Shift while tapping, one for releasing a layer key while tapping. |
What is needed to get this merged? It solves an annoyance for me and it would be nice not having to maintain this as a private patch :) |
Move most #ifdefs into conditionally defined macros to make the logic easier to follow. Signed-off-by: Felix Kuehling <[email protected]>
This allows mod-tap and layer-tap keys on layers to behave as expected. Bug: qmk#17281 Signed-off-by: Felix Kuehling <[email protected]>
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]>
@precondition reading through the discussions and the code changes it seems that most (if not all?) have come to a resolution, if so could you resolve them? @fxkuehl reading through the code nothing stands out for me that would prevent a merge from my side. I'm going to try out the changes and add my approval. Thanks for the bugfix and cleaning up that mess that |
Uh, I don't see a "Resolve" button anywhere in my previous review. Isn't that something that's only shown to the author of the PR? I can make a new approving review though. |
Interesting, I thought that you should be able to resolve those 🤔 anyway, if you are happy with the current changes I can resolve the threads for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been testing this PR and haven't encountered any problems. The changes also LGTM! Thanks!
# else | ||
# define TAP_GET_RETRO_TAPPING true | ||
# endif | ||
# define MAYBE_RETRO_SHIFTING(ev) (TAP_GET_RETRO_TAPPING && (RETRO_SHIFT + 0) != 0 && TIMER_DIFF_16((ev).time, tapping_key.event.time) < (RETRO_SHIFT + 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand why did you prefix the macro name with "maybe"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are more conditions that are checked before the actual retry-shifting code (e.g. tapping_key.tap.count == 0). The condition here is necessary but not sufficient for retro shifting.
Thank you for your contribution! |
What do I need to do to get this merged. I don't think it should just be closed for being stale. |
It won't be closed 👍, at the moment it is just missing one more review from a collaborator and then it can be merged. |
@fxkuehl now that all approvals are in we can merge your PR next week after the breaking changes merge from |
* 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]>
* 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]>
* 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]>
Description
"Retain momentary layers until the end of tapping" is my solution for Bug17281.
"Make process_tapping more readable" helped me understand the code better as I was investigating this problem. I'm including it for consideration. It's purely for readability and should have no impact on functionality. It is not needed to fix the bug.
Types of Changes
Issues Fixed or Closed by This PR
Checklist