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

Do not enable PERMISSIVE_HOLD when TAPPING_TERM exceeds 500ms #15674

Merged
merged 4 commits into from
Jun 24, 2022

Conversation

precondition
Copy link
Contributor

@precondition precondition commented Dec 30, 2021

Description

Do not enable PERMISSIVE_HOLD-like behaviour when TAPPING_TERM ≥ 500ms.

This is a poorly documented obscure "feature" that's entirely unnecessary and does more harm than good. When people are testing dual-role keys like MT(), they need to play around with the different tap-hold option and tweak their tapping term in order to limit misfires. A lot of times, people enable IGNORE_MOD_TAP_INTERRUPT because this is the option that is the most restrictive when it comes to selecting the hold action (desirable for a person using home row mods for example) but because they're not used to it, they get a lot of misfires. In which case, they're advised to increase the tapping term.

However, some users crank it way above 500ms "just to be safe" and make it very hard to accidentally trigger a hold. That's when QMK "helpfully" enables permissive hold (despite the user not having enabled the setting in config.h) under their nose. Now, when testing, the user encounters even more misfires than before because permissive hold activates an additional way to trigger holds. This only serves to frustrate the users and push them away from exploiting the full capacities of the advanced tap-hold mechanics that QMK offers.

Finally, this PR is not a loss of functionality because one only needs to add #define PERMISSIVE_HOLD to their config.h to get the behaviour if they so desire. Furthermore, you can expect this PR to free up about 55 bytes in keymaps that don't enable PERMISSIVE_HOLD. (Everything counts on AVR)

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Copy link
Member

@drashna drashna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code change looks good. But I'm not sure that this is for the best.

@drashna drashna requested a review from a team March 8, 2022 04:22
@precondition
Copy link
Contributor Author

precondition commented May 5, 2022

keyboards/helix/pico/keymaps/mtei/config.h:#define TAPPING_TERM 300
keyboards/helix/pico/keymaps/mtei/config.h:#define PERMISSIVE_HOLD
keyboards/helix/pico/keymaps/mtei/config.h:/* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD.
keyboards/helix/pico/keymaps/mtei/config.h:   see tmk_core/common/action_tapping.c */
--
keyboards/helix/rev2/keymaps/five_rows/config.h:#define TAPPING_TERM 300
keyboards/helix/rev2/keymaps/five_rows/config.h:#define PERMISSIVE_HOLD
keyboards/helix/rev2/keymaps/five_rows/config.h:/* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD.
keyboards/helix/rev2/keymaps/five_rows/config.h:   see tmk_core/common/action_tapping.c */
--
keyboards/helix/rev3_5rows/keymaps/five_rows/config.h:#define TAPPING_TERM 300
keyboards/helix/rev3_5rows/keymaps/five_rows/config.h:#define PERMISSIVE_HOLD
keyboards/helix/rev3_5rows/keymaps/five_rows/config.h:/* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD.
keyboards/helix/rev3_5rows/keymaps/five_rows/config.h:   see tmk_core/common/action_tapping.c */
--
layouts/community/ergodox/adam/config.h:
layouts/community/ergodox/adam/config.h:#undef TAPPING_TERM
layouts/community/ergodox/adam/config.h:#define TAPPING_TERM 300 //At 500 some bad logic takes hold
layouts/community/ergodox/adam/config.h:#define IGNORE_MOD_TAP_INTERRUPT

Can I also remove these (would-be-)outdated comments?

Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other then the rebase this LGTM! Thanks.

quantum/action_tapping.c Show resolved Hide resolved
quantum/action_tapping.c Show resolved Hide resolved
@KarlK90
Copy link
Member

KarlK90 commented Jun 24, 2022

Can I also remove these (would-be-)outdated comments?

Yes, please remove them. This doesn't need confirmation from the owners as it just rectifies the situation.

@KarlK90
Copy link
Member

KarlK90 commented Jun 24, 2022

One more request:

❯ rg "TAPPING_TERM [5-9]\d\d"
users/wanleg/config.h
14:#define TAPPING_TERM 700

keyboards/1k/keymaps/tap_dance/config.h
6:#define TAPPING_TERM 500

keyboards/idobao/id67/keymaps/thewerther/config.h
20:#define TAPPING_TERM 500

keyboards/handwired/onekey/config.h
44:#define TAPPING_TERM 500

keyboards/handwired/ergocheap/config.h
49:#define TAPPING_TERM 500

keyboards/handwired/uthol/rev3/config.h
59:#define TAPPING_TERM 500

keyboards/xiudi/xd002/keymaps/tap_dance/config.h
3:#define TAPPING_TERM 500

keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h
5:#define TAPPING_TERM 500

keyboards/keebio/quefrency/keymaps/bjohnson/config.h
29:#define TAPPING_TERM 500

keyboards/thevankeyboards/minivan/keymaps/halvves/config.h
3:#define TAPPING_TERM 505

keyboards/thevankeyboards/minivan/keymaps/belak/config.h
6:#define TAPPING_TERM 500

keyboards/flehrad/bigswitch/keymaps/333fred/config.h
26:#define TAPPING_TERM 500

keyboards/zfrontier/big_switch/config.h
53:#define TAPPING_TERM 500

layouts/community/66_ansi/xyverz/config.h
3:#define TAPPING_TERM 600 // ms

❯ rg "TAPPING_TERM \d\d\d\d"
keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/config.h
21:#define TAPPING_TERM 1000

keyboards/massdrop/alt/keymaps/favorable-mutation/config.h
24:#define TAPPING_TERM 1000

users/hvp/config.h
18:#define LONG_TAPPING_TERM 1000

These configs should get #define PERMISSIVE_HOLD as they expected (?) or at least use this behavior.

@filterpaper
Copy link
Contributor

Do we typically have to manage user config/keymaps for breaking changes?

@KarlK90
Copy link
Member

KarlK90 commented Jun 24, 2022

Do we typically have to manage user config/keymaps for breaking changes?

I would say that QMK should not break user space if it is possible. So if there is a trivial backwards compatible conversion it should be done in the PR.

@precondition
Copy link
Contributor Author

precondition commented Jun 24, 2022

Yes, please remove them. This doesn't need confirmation from the owners as it just rectifies the situation.

Solved in 9167f41

These configs should get #define PERMISSIVE_HOLD as they expected (?) or at least use this behavior.

Solved in f3e9fa7

~/qmk_firmware on tap_term_500 *3 ⨤7                                                                                                
❯ grep -c PERMISSIVE_HOLD users/wanleg/config.h keyboards/1k/keymaps/tap_dance/config.h keyboards/idobao/id67/keymaps/thewerther/config.h keyboards/handwired/onekey/config.h keyboards/handwired/ergocheap/config.h keyboards/handwired/uthol/rev3/config.h keyboards/xiudi/xd002/keymaps/tap_dance/config.h keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h keyboards/keebio/quefrency/keymaps/bjohnson/config.h keyboards/thevankeyboards/minivan/keymaps/halvves/config.h keyboards/thevankeyboards/minivan/keymaps/belak/config.h keyboards/flehrad/bigswitch/keymaps/333fred/config.h keyboards/zfrontier/big_switch/config.h layouts/community/66_ansi/xyverz/config.h keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/config.h keyboards/massdrop/alt/keymaps/favorable-mutation/config.h users/hvp/config.h
users/wanleg/config.h:1
keyboards/1k/keymaps/tap_dance/config.h:1
keyboards/idobao/id67/keymaps/thewerther/config.h:1
keyboards/handwired/onekey/config.h:1
keyboards/handwired/ergocheap/config.h:1
keyboards/handwired/uthol/rev3/config.h:1
keyboards/xiudi/xd002/keymaps/tap_dance/config.h:1
keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h:1
keyboards/keebio/quefrency/keymaps/bjohnson/config.h:1
keyboards/thevankeyboards/minivan/keymaps/halvves/config.h:1
keyboards/thevankeyboards/minivan/keymaps/belak/config.h:1
keyboards/flehrad/bigswitch/keymaps/333fred/config.h:1
keyboards/zfrontier/big_switch/config.h:1
layouts/community/66_ansi/xyverz/config.h:1
keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/config.h:1
keyboards/massdrop/alt/keymaps/favorable-mutation/config.h:1
users/hvp/config.h:1

Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for quickly implementing the changes.

quantum/action_tapping.c Outdated Show resolved Hide resolved
Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All test are green now. This is good to go.

@KarlK90 KarlK90 merged commit 3b9e186 into qmk:develop Jun 24, 2022
@precondition
Copy link
Contributor Author

It also passes all the new tap hold configuration unit tests I had added in #15741 so that's extra re-insurance

0xcharly pushed a commit to Bastardkb/bastardkb-qmk that referenced this pull request Jul 4, 2022
@precondition precondition deleted the tap_term_500 branch October 5, 2022 07:56
nolanseaton pushed a commit to nolanseaton/qmk_firmware that referenced this pull request Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants