-
-
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
Remove IGNORE_MOD_TAP_INTERRUPT_PER_KEY in favour of HOLD_ON_OTHER_KEY_PRESS_PER_KEY #15741
Conversation
8ee2d2c
to
9301269
Compare
With this PR and |
Nice job on the edge cases - you caught a lot of things I wouldn't have thought of. |
@IsaacElenbaas The expected behaviour is described in the new tables I've added to the tap-hold docs. Here's how rolling key presses should behave in theory (This is taken from the new docs so "Default" means the new default):
I couldn't reproduce the bug with If you did in fact spell it correctly in |
I've done it before and did it again 🙁 Looks good with Retro Shift on my end. |
If it makes you feel any better, I've done similar ... more than a few times. |
3a58643
to
a337d87
Compare
c8d9d80
to
a4a0c4d
Compare
I squashed and restructured my commits so that each commit only touches a specific folder. This should be easier to follow. The underlying code changes remain the same though. |
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.
Thanks @precondition for wadding through the action_tapping.c
pasta and implementing this feature. The changes look good to me although I have yet to try them out on a board, but you have my approval on this PR. During review I found these issues, let me know if you disagree:
Unit-tests:
- Please move the ignore_mod_tap_interrupt tests into default_mod_tap (maybe rename to default tapping?) behaviour tests, as they are the new default behaviour.
- Altough you didn't implement the
HOLD_ON_OTHER_KEY_PRESS
feature I still would like unit-tests for this behaviour to be added as part of this PR, to increase the coverage and I think it is a good oppurtunity as you are familiar with the behavour. Would that be acceptable for you?
Backwards compatibility:
-
The now de-funct
IGNORE_MOD_TAP_INTERRUPT_PER_KEY
andIGNORE_MOD_TAP_INTERRUPT
defines should be removed from all keebs as they are dead code prefeerably in a seperate commit to make the review easier. -
To mimic the old behavior especially for people that prefer the old default, we need to rename
get_ignore_mod_tap_interrupt
toget_hold_on_other_key_press
on keymap level plus inversion of logic by enablingHOLD_ON_OTHER_KEY_PRESS
for these keymaps.
I found these keymaps to still use the now defunct get_ignore_mod_tap_interrupt
override:
rg get_ignore_mod_tap_interrupt
keyboards/converter/usb_usb/keymaps/chriskopher/keymap.c
178:bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
keyboards/handwired/dactyl_manuform/5x6_5/keymaps/cykedev/keymap.c
198:bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
keyboards/bastardkb/scylla/keymaps/cykedev/keymap.c
172:bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
keyboards/torn/keymaps/kinesish/keymap.c
140:bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
keyboards/crkbd/keymaps/snowe/keymap.c
182:// bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
keyboards/ergodox_ez/keymaps/stamm/keymap.c
209:bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
keyboards/planck/keymaps/rootiest/keymap.c
1373:bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t* record) {
keyboards/planck/keymaps/adamtabrams/keymap.c
258:bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
keyboards/lily58/keymaps/cykedev/keymap.c
99:bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
users/drashna/keyrecords/tapping.c
39:__attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
28a2909
to
ed93d15
Compare
@KarlK90 Doesn't that count as “changing user code en masse”, which @fauxpark advised against, in this comment on another PR? |
Probably, but I would argue that 9 keymaps (1 is already commented out) to change don't count as a en masse change. But the people would have to be notified and sign off on this change though. |
4ebb979
to
5c2de6f
Compare
@cykedev @chriskopher @snowe2010 @stamm @adamtabrams @rootiest @Cy6erBr4in @drashna Your personal keymap code was adapted in a backwards-compatible way (meaning, it will still act the same as before) in commit e94cdb5. Since this commit/update affects your personal keymap files, I need a sign-off from you, agreeing to the proposed changes in order to proceed. PS: When I say "proposed changes", I'm only talking about commit e94cdb5. I'm not asking you to review this whole PR but feel free to do it if you want ;) |
@KarlK90 Do you mean only removing it from keyboard-level config.h files as I've done in commit ab78408 or should I also remove them from users' keymap-level config.h files? |
@precondition this is fine for me |
As they have no usage anymore or rather are the new default, please remove them completely. A ping is not necessary here because the functionality doesn't change. |
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.
Looking forward to have IGNORE_MOD_TAP_INTERRUPT
the default behavior in the future! Thanks for pushing this and your work.
@precondition sorry one more rebase after #17007 was merged |
*I_M_T_I_P_K = IGNORE_MOD_TAP_INTERRUPT_PER_KEY
*I_M_T_I_P_K=IGNORE_MOD_TAP_INTERRUPT_PER_KEY *H_O_O_K_P=HOLD_ON_OTHER_KEY_PRESS
…nother_mod_tap_key_is_held
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.
Ticking off the director review. Will merge once conflicts are sorted.
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.
Let's try that again with the correct permissions.
When rebasing commit e1c457456f86b1c5024ca38b58df3f6a76d161e7, I realized that I can't just rename |
Remove mention of layer-taps in IMTI* deprecation message IMTI* = IGNORE_MOD_TAP_INTERRUPT
3188d6c
to
8d91044
Compare
2465d21
to
478d8a5
Compare
Description
Deprecate IGNORE_MOD_TAP_INTERRUPT_PER_KEY as a stepping stone towards making IGNORE_MOD_TAP_INTERRUPT the new default behaviour for modtaps.
Old description from the time the PR was about setting IGNORE_MOD_TAP_INTERRUPT as the new default behaviour
TL;DR This PR removes `IGNORE_MOD_TAP_INTERRUPT` and makes it the default behaviour for mod-taps.If we compare mod-tap behaviour with layer-tap behaviour, we get this:
HOLD_ON_OTHER_KEY_PRESS
for layer-tapsIGNORE_MOD_TAP_INTERRUPT
for mod-taps = default layer-tap behaviour(Where "default" refers to no particular tap hold settings enabled for this type of dual-role key and "old" refers to any QMK version without this PR)
To make this easier, let's call the current/old default MT behaviour as
HOLD_ON_INTERRUPT
since it chooses the hold action as soon as an interrupting key is pressed. @sigprof 'sHOLD_ON_OTHER_KEY_PRESS
works exactly the same way asHOLD_ON_INTERRUPT
except thatHOLD_ON_OTHER_KEY_PRESS
has shorter key delays, i.e. it takes the tap-or-hold decision slightly faster and sends the keyboard report to the host earlier.Ideally, the default behaviour for layer-taps should be consistent with that of mod-taps. The best candidate for "default" behaviour is an option that takes the longest to make the tap-or-hold decision.
It is a bad idea to keep a
HOLD_ON_INTERRUPT
-like behaviour as default for modtaps (like it currently is) because this is the option that takes the shortest to make the tap-or-hold decision. This means that enabling additional options likePERMISSIVE_HOLD
is unnoticeable becauseHOLD_ON_INTERRUPT
short-circuits the decision. Users have to explicitly disable this hold-on-interrupt by definingIGNORE_MOD_TAP_INTERRUPT
in order for extra tap-hold settings to actually take effect.Consider the following chain of event, highlighting how
HOLD_ON_INTERRUPT
/HOLD_ON_OTHER_KEY_PRESS
short-circuits the tap-or-hold decision (mt is released before the tapping term expired):Furthermore, the doc page on tap hold settings clearly states that "IGNORE_INTERRUPT" is the default behaviour for dual-role keys:
This PR brings the code in alignment to what the documentation says.
These changes also simplified a great deal the tap hold documentation page that most people find very hard to understand.
Finally, this does not break any existing build (
#define IGNORE_MOD_TAP_INTERRUPT[_PER_KEY]
andget_ignore_mod_tap_interrupt()
merely become a no-op, with no compiler error) and despite the diff looking mostly red, no loss of functionality occurs.Types of Changes
Issues Fixed or Closed by This PR
Checklist