-
-
Notifications
You must be signed in to change notification settings - Fork 39.3k
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
Add HOLD_ON_OTHER_KEY_PRESS option for dual-role keys #9404
Conversation
After some more testing I found that the same thing happens even without LT and without any of changes from this PR — So the code from this PR does not actually cause that bug, and I could mark it as ready for review. |
So, basically .... this would be
Yeah, this is normal, and is what Tapping Force Hold exists for. |
Yes, but not just for Layer Tap (although the only other thing which seems to be similar to Mod Tap and Layer Tap is
I'm not sure how Tapping Force Hold would help here — it affects the case when the same key is pressed multiple times, and in that case ( |
Also, this should probably target the |
Thank you for your contribution! |
Probably it should, but I don't see where in the GitHub interface I can change the requested target branch; maybe only someone with more privileges can do it? |
155cc17
to
5c3043b
Compare
I've tried this on my fork. It works completely as I expect and makes me so happy. Thanks! |
This is a great addition that brings layer-taps customization on par with mod-taps but I can see how it can confuse a lot of users.
(Where "default" refers to no particular tap hold settings enabled for this type of dual-role key) Ideally, we would make EDIT: After mulling it over, I've come to the conclusion that doing it the other way around is better i.e. make It would be much more consistent and easier to reason about. Tap hold configuration settings are hard enough to understand as is. The downside to my suggestion is that people who are used to a (Judging from the QMK-related discussions I've had about layer-taps, I feel like |
I think that @precondition makes a very good point here. Also, it looks like you have some merge conflicts here. |
I am trying to figure out how tap-hold configuration works and I ended up at #8971 and here. Short summary of my post is: current options are already quite confusing and adding more would make the situation even worse. I think it is better to introduce new, clearer and more consistent, options to control LT and MT behavior instead. First, some observations, looking at the summary table with MT/LT behavior (made by @sigprof in #8971):
Taking these into account, we can reduce the states to these (a copy of the original table, see the "Summary (short)" sheet):
Summarizing the information:
Now, the suggestion by @precondition above, if I understand it right, would look like this:
Putting breaking changes aside, I think it will still be quite confusing due to the amount of options and inconsistent naming: here we still have to play with combinations of options, plus we now have I think, ideally, the behavior would be set by choosing one of the possible options instead of setting flags. Similarly, there could be I do not know if having different settings for Not sure if this makes sense, but I would suggest introducing new-style options here and deprecating both PERMISSIVE_HOLD and IGNORE_MOD_TAP_INTERRUPT. |
It's not a good idea to use the word "always" here. "Always Hold" would no longer be a dual-role key, it would just be the equivalent of
It's normal that Permissive hold is an option that adds another way to trigger the hold function of dual-role keys. Whereas the modifier of the mod-tap is activated when another key gets pressed by default or gets activated when held down for longer than the tapping term if The default To be honest, phrases like "work better for fast typists" should be removed from the Tap Hold docs in my opinion. It's way too subjective and potentially misleading. It makes it seem like people who type under 100WPM have nothing to gain from enabling this feature.
You're paraphrasing this section of the Tap Hold docs. Although as I've already explained before, the use of the word "always" is rather misleading in this context. I personally prefer the default–permissive hold–hold on other key press vocabulary that is used in the docs of this PR. It puts the Tap-or-Hold decision modes on a spectrum from least likely to trigger the hold function to most likely to trigger the hold function.
I confirm.
Yes, and that's very problematic.
No, they work the same. The reason you think
The way to do what you call But other than that, yes, that's what I was suggesting. However, after re-reading "Tap-Or-Hold Decision Modes", I'm starting to think that @sigprof's decision of what should be the default behaviour is more sound. The default behaviour should be the one that chooses the tap function in most scenarios. That means making Making
Yes, the tap hold options should be standardized and use the same naming schemes for LT and MT. Although I'm not sure what you mean by "plus we now have
I believe it is important to keep the ability to customize both. To give an example, I know some people who can't get used to If we don't want duplicate Tap-or-Hold options for MT and for LT, we can just propose a per-key variant and let people define the dual role keys on which they want a particular option to apply on. That's exactly what the person whose message I've shared here does with
We should leave |
@precondition thank you for the details, as well as for the home row mods guide (which, by the way, was a starting point for my research of these settings). I agree on the terminology point, by "Always Hold" and "Always Tap" I only meant interactions that are happening during the tapping term, so there should be better naming for this. Although my main point was that current settings are quite confusing and it would be good to step back, review the current state and see how to improve it. I also just got an idea to look around and see how this is done in other firmwares and it turns out ZMK has it like this:
These flavors look very close to the three behaviors I we have discussed above and it is easier to have just one setting to choose the desired behavior (like Anyway, I think at this point it would be beneficial to merge this PR as it is: the situation is already complex, but at least there will be a way to configure the LT behavior. Improvements to make it clearer could be done later. And it looks like |
5c3043b
to
2e8ea3a
Compare
I rebased the branch and fixed conflicts in the documentation (the actual code is still unchanged and works). The suggestion by @serebrov to change the hold-tap configuration to an enum instead of some boolean options which are not really independent looks nice, but removing unused code would not be as easy as it is with the existing boolean options (if you don't use BTW, another piece of software that supports dual-role keys is KMonad, and it has these options to configure the behavior of dual-role keys:
I also really don't like the current non- |
@sigprof If we don't want misleading docs, the default behaviour of modtaps will need to also be the "mode [that] selects the hold action only if the dual-role key is held down longer than the tapping term". Given that, we can make |
Just a note for people coming from Karabiner/google: This would support |
Implement an additional option for dual-role keys which converts the dual-role key press into a hold action immediately when another key is pressed (this is different from the existing PERMISSIVE_HOLD option, which selects the hold action when another key is tapped (pressed and then released) while the dual-role key is pressed). The Mod-Tap keys already behave in a similar way, unless the IGNORE_MOD_TAP_INTERRUPT option is enabled (but with some additional delays); the added option makes this behavior available for all other kinds of dual-role keys.
Document the newly added HOLD_ON_OTHER_KEY_PRESS option and update the documentation for closely related options (PERMISSIVE_HOLD and IGNORE_MOD_TAP_INTERRUPT). Use Layer Tap instead of Mod Tap in examples for PERMISSIVE_HOLD and HOLD_ON_OTHER_KEY_PRESS, because the effect of using these options with Mod Tap keys is mostly invisible without IGNORE_MOD_TAP_INTERRUPT. Add comments before return statements in sample implementations of `get_ignore_mod_tap_interrupt()`, `get_hold_on_other_key_press()` and `get_permissive_hold()`. Thanks to @Erovia and @precondition for comments and suggestions to improve the documentation.
2e8ea3a
to
1686b3e
Compare
Rebased onto the current develop branch, because the code needed a minor change for compatibility with #8591 ( |
@sigprof , thanks for your work! What about SH_T()? Can we use this new feature to modify Swap Hands behaviour? As far as I could test, the answer is "no". Am I missing something? |
* Add HOLD_ON_OTHER_KEY_PRESS option for dual-role keys Implement an additional option for dual-role keys which converts the dual-role key press into a hold action immediately when another key is pressed (this is different from the existing PERMISSIVE_HOLD option, which selects the hold action when another key is tapped (pressed and then released) while the dual-role key is pressed). The Mod-Tap keys already behave in a similar way, unless the IGNORE_MOD_TAP_INTERRUPT option is enabled (but with some additional delays); the added option makes this behavior available for all other kinds of dual-role keys. * [Docs] Update tap-hold docs for HOLD_ON_OTHER_KEY_PRESS Document the newly added HOLD_ON_OTHER_KEY_PRESS option and update the documentation for closely related options (PERMISSIVE_HOLD and IGNORE_MOD_TAP_INTERRUPT). Use Layer Tap instead of Mod Tap in examples for PERMISSIVE_HOLD and HOLD_ON_OTHER_KEY_PRESS, because the effect of using these options with Mod Tap keys is mostly invisible without IGNORE_MOD_TAP_INTERRUPT. Add comments before return statements in sample implementations of `get_ignore_mod_tap_interrupt()`, `get_hold_on_other_key_press()` and `get_permissive_hold()`. Thanks to @Erovia and @precondition for comments and suggestions to improve the documentation.
* Add HOLD_ON_OTHER_KEY_PRESS option for dual-role keys Implement an additional option for dual-role keys which converts the dual-role key press into a hold action immediately when another key is pressed (this is different from the existing PERMISSIVE_HOLD option, which selects the hold action when another key is tapped (pressed and then released) while the dual-role key is pressed). The Mod-Tap keys already behave in a similar way, unless the IGNORE_MOD_TAP_INTERRUPT option is enabled (but with some additional delays); the added option makes this behavior available for all other kinds of dual-role keys. * [Docs] Update tap-hold docs for HOLD_ON_OTHER_KEY_PRESS Document the newly added HOLD_ON_OTHER_KEY_PRESS option and update the documentation for closely related options (PERMISSIVE_HOLD and IGNORE_MOD_TAP_INTERRUPT). Use Layer Tap instead of Mod Tap in examples for PERMISSIVE_HOLD and HOLD_ON_OTHER_KEY_PRESS, because the effect of using these options with Mod Tap keys is mostly invisible without IGNORE_MOD_TAP_INTERRUPT. Add comments before return statements in sample implementations of `get_ignore_mod_tap_interrupt()`, `get_hold_on_other_key_press()` and `get_permissive_hold()`. Thanks to @Erovia and @precondition for comments and suggestions to improve the documentation.
Description
Implement an additional
HOLD_ON_OTHER_KEY_PRESS
option for dual-role keys which converts the dual-role key press into a hold action immediately when another key is pressed (this is different from the existingPERMISSIVE_HOLD
option, which selects the hold action when another key is tapped (pressed and then released) while the dual-role key is pressed). The Mod-Tap keys already behave in a similar way, unless theIGNORE_MOD_TAP_INTERRUPT
option is enabled (but with some additional delays); the added option makes this behavior available for all other kinds of dual-role keys.Types of Changes
Issues Fixed or Closed by This PR
Checklist