Skip to content

Commit

Permalink
Make IGNORE_MOD_TAP_INTERRUPT the default behaviour for mod-taps (qmk…
Browse files Browse the repository at this point in the history
  • Loading branch information
precondition authored and coquizen committed Jun 22, 2023
1 parent b33e2e8 commit a4a5a2e
Show file tree
Hide file tree
Showing 286 changed files with 28 additions and 729 deletions.
2 changes: 1 addition & 1 deletion data/mappings/info_config.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"QMK_KEYS_PER_SCAN": {"info_key": "qmk.keys_per_scan", "value_type": "int", "deprecated": true},
"TAPPING_FORCE_HOLD": {"info_key": "tapping.force_hold", "value_type": "bool", "deprecated": true},
"TAPPING_FORCE_HOLD_PER_KEY": {"info_key": "tapping.force_hold_per_key", "value_type": "bool", "deprecated": true},
"IGNORE_MOD_TAP_INTERRUPT": {"info_key": "_deprecated.ignore_mod_tap_interrupt", "value_type": "bool", "deprecated": true},
"IGNORE_MOD_TAP_INTERRUPT": {"info_key": "_invalid.ignore_mod_tap_interrupt", "value_type": "bool", "invalid": true},
"IGNORE_MOD_TAP_INTERRUPT_PER_KEY": {"info_key": "_invalid.ignore_mod_tap_interrupt_per_key", "invalid": true}

// USB params, need to mark as failure when specified in config.h, rather than deprecated
Expand Down
5 changes: 1 addition & 4 deletions docs/config_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ If you define these options you will enable the associated feature, which may in
* `#define TAPPING_TERM_PER_KEY`
* enables handling for per key `TAPPING_TERM` settings
* `#define RETRO_TAPPING`
* tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release
* tap anyway, even after `TAPPING_TERM`, if there was no other key interruption between press and release
* See [Retro Tapping](tap_hold.md#retro-tapping) for details
* `#define RETRO_TAPPING_PER_KEY`
* enables handling for per key `RETRO_TAPPING` settings
Expand All @@ -161,9 +161,6 @@ If you define these options you will enable the associated feature, which may in
* See [Permissive Hold](tap_hold.md#permissive-hold) for details
* `#define PERMISSIVE_HOLD_PER_KEY`
* enabled handling for per key `PERMISSIVE_HOLD` settings
* `#define IGNORE_MOD_TAP_INTERRUPT`
* makes it possible to do rolling combos (zx) with keys that convert to other keys on hold, by enforcing the `TAPPING_TERM` for both keys.
* See [Ignore Mod Tap Interrupt](tap_hold.md#ignore-mod-tap-interrupt) for details
* `#define QUICK_TAP_TERM 100`
* tap-then-hold timing to use a dual role key to repeat keycode
* See [Quick Tap Term](tap_hold.md#quick-tap-term)
Expand Down
3 changes: 0 additions & 3 deletions docs/ja/config_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ QMK での全ての利用可能な設定にはデフォルトがあります。
* 詳細は [Permissive Hold](ja/tap_hold.md#permissive-hold) を見てください
* `#define PERMISSIVE_HOLD_PER_KEY`
* キーごとの `PERMISSIVE_HOLD` 設定の処理を有効にします
* `#define IGNORE_MOD_TAP_INTERRUPT`
* 両方のキーに `TAPPING_TERM` を適用することで、ホールド時に他のキーに変換するキーを使ってローリングコンボ (zx) をすることができるようにします
* 詳細は [Ignore Mod Tap Interrupt](ja/tap_hold.md#ignore-mod-tap-interrupt) を見てください
* `#define TAPPING_FORCE_HOLD`
* タップされた直後に、デュアルロールキーを修飾子として使用できるようにします
* [Tapping Force Hold](ja/tap_hold.md#tapping-force-hold)を見てください
Expand Down
28 changes: 0 additions & 28 deletions docs/ja/tap_hold.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {

通常、これら全てを `TAPPING_TERM` (デフォルト: 200ms) 内で行うと、ファームウェアとホストシステムによって `ax` として登録されます。許容ホールドを有効にすると、別のキーがタップされた場合にモッドタップキーを修飾キーと見なすように処理を変更し、 `X` (`SHIFT`+`x`) と登録されます。

?> `モッドタップ割り込みの無視`を有効にしている場合、これにより両方の動きが変更されます。通常のキーには、最初のキーが最初に放された場合、あるいは両方のキーが `TAPPING_TERM` より長くホールドされた場合に、修飾キーが追加されます。

この機能をより細かく制御するために、以下を `config.h` に追加することができます:

```c
Expand All @@ -84,32 +82,6 @@ bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) {
}
```
## モッドタップ割り込みの無視
この設定を有効にするには、これを `config.h` に追加してください:
```c
#define IGNORE_MOD_TAP_INTERRUPT
```

許容ホールドと同様に、これは高速なタイピストのためのファームウェアの処理方法を変更します。モッドタップキーを押し、他のキーを押し、モッドタップキーを放し、通常のキーを放すと、`TAPPING_TERM` 内で押された場合でも、通常はモッドと通常のキーが出力されます。これは、ローリングコンボキーや、頻繁に使用するキー(例えば、`RCTL_T(KC_QUOT)`)にモッドタップを使う高速なタイピストには望ましくない場合があります。

`モッドタップ割り込みの無視`を設定するには、両方のキーを `TAPPING_TERM` の間ホールドすると、(その修飾キーの)ホールド機能を実行する必要があります。

例えば:

- `SFT_T(KC_A)` を押す
- `KC_X` を押す
- `SFT_T(KC_A)` を放す
- `KC_X` を放す

通常、これは大文字の `X` (`SHIFT`+`x`)、またはモッド + キーを送信します。`モッドタップ割り込みの無視` を有効にすると、ホールドアクションを登録するには、両方のキーを `TAPPING_TERM` の間ホールドする必要があります。この場合、素早いタップは `ax` を送信しますが、両方をホールドすると、大文字の `X` (`SHIFT`+`x`) を出力します。


?> __注意__: これはモディファイアにのみ関係し、レイヤー切り替えキーには関係しません。

?> `許容ホールド`を有効にすると、これは両方がどのように動作するかを変更します。通常のキーには、最初のキーが最初に放された場合、あるいは両方のキーが `TAPPING_TERM` より長くホールドされた場合に、修飾キーが追加されます。

## タッピング強制ホールド
`タッピング強制ホールド` を有効にするには、以下を `config.h` に追加します:
Expand Down
2 changes: 0 additions & 2 deletions docs/mod_tap.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
```
Enabling `IGNORE_MOD_TAP_INTERRUPT` is recommended when using Mod-Tap on alphanumeric keys to avoid hold function taking precendence when the next key is pressed quickly. See [Ignore Mod Tap Interrupt](tap_hold.md#ignore-mod-tap-interrupt) for more details.
### Changing both tap and hold
This last example implements custom tap and hold function with `LT(0,KC_NO)` to create a single copy-on-tap, paste-on-hold key:
Expand Down
89 changes: 9 additions & 80 deletions docs/tap_hold.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,18 @@ Note that until the tap-or-hold decision completes (which happens when either th
To better illustrate the tap-or-hold decision modes, let us compare the expected output of each decision mode in a handful of tapping scenarios involving a mod-tap key (`LSFT_T(KC_A)`) and a regular key (`KC_B`) with the `TAPPING_TERM` set to 200ms.
By default, mod-taps behave like `HOLD_ON_OTHER_KEY_PRESS`, while layer-taps behave like "Ignore Interrupt" out of the box. If you want "Ignore Interrupt"-like behaviour for mod-taps, you must enable `IGNORE_MOD_TAP_INTERRUPT`, or return `false` in the `get_hold_on_other_key_press` function for all mod-taps.
Note: "`kc` held" in the "Physical key event" column means that the key wasn't physically released yet at this point in time.
#### Distinct taps (AABB) :id=distinct-taps
| Time | Physical key event |Ignore Interrupt| `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
|------|--------------------|----------------|-------------------|----------------------------|
| 0 | `LSFT_T(KC_A)` down| | | |
| 199 | `LSFT_T(KC_A)` up | a | a | a |
| 210 | `KC_B` down | ab | ab | ab |
| 220 | `KC_B` up | ab | ab | ab |
| Time | Physical key event |Ignore Interrupt| `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
|------|--------------------|----------------|-------------------|----------------------------|
| 0 | `LSFT_T(KC_A)` down| | | |
| 200 | `LSFT_T(KC_A)` held|<kbd>Shift</kbd>| <kbd>Shift</kbd> | <kbd>Shift</kbd> |
Expand All @@ -153,22 +151,22 @@ Note: "`kc` held" in the "Physical key event" column means that the key wasn't p
#### Nested tap (ABBA) :id=nested-tap
| Time | Physical key event |Ignore Interrupt| `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
|------|--------------------|----------------|-------------------|----------------------------|
| 0 | `LSFT_T(KC_A)` down| | | |
| 110 | `KC_B` down | | | B |
| 120 | `KC_B` up | | B | B |
| 199 | `LSFT_T(KC_A)` up | ab | B | B |
| Time | Physical key event |Ignore Interrupt| `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
|------|--------------------|----------------|-------------------|----------------------------|
| 0 | `LSFT_T(KC_A)` down| | | |
| 110 | `KC_B` down | | | B |
| 120 | `KC_B` up | | B | B |
| 200 | `LSFT_T(KC_A)` held| B | B | B |
| 210 | `LSFT_T(KC_A)` up | B | B | B |
| Time | Physical key event |Ignore Interrupt| `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
|------|--------------------|----------------|-------------------|----------------------------|
| 0 | `LSFT_T(KC_A)` down| | | |
| 200 | `LSFT_T(KC_A)` held|<kbd>Shift</kbd>| <kbd>Shift</kbd> | <kbd>Shift</kbd> |
Expand All @@ -178,14 +176,14 @@ Note: "`kc` held" in the "Physical key event" column means that the key wasn't p
#### Rolling keys (ABAB) :id=rolling-keys
| Time | Physical key event |Ignore Interrupt| `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
|------|--------------------|----------------|-------------------|----------------------------|
| 0 | `LSFT_T(KC_A)` down| | | |
| 110 | `KC_B` down | | | B |
| 130 | `LSFT_T(KC_A)` up | ab | ab | B |
| 140 | `KC_B` up | ab | ab | B |
| Time | Physical key event |Ignore Interrupt| `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
| Time | Physical key event | Default | `PERMISSIVE_HOLD` | `HOLD_ON_OTHER_KEY_PRESS` |
|------|--------------------|----------------|-------------------|----------------------------|
| 0 | `LSFT_T(KC_A)` down| | | |
| 110 | `KC_B` down | | | B |
Expand Down Expand Up @@ -241,10 +239,8 @@ Example sequence 3 (Mod Tap):
| +--------------+ | |
+---------------------------|--------+
```
Based on previous examples, you might have expected the output of the above sequence to be `KC_A` `KC_X`
since `SFT_T(KC_A)` is NOT held longer than the `TAPPING_TERM`.
However, the actual output would be capital `X` (`SHIFT` + `x`) due to reasons
explained under [Ignore Mod Tap Interrupt](#ignore-mod-tap-interrupt).
In the above sequence, `SFT_T(KC_A)` has been released before the end of its `TAPPING_TERM` and as such will be interpreted as `KC_A`,
followed by any key event that happened after the initial press of `SFT_T(KC_A)`. In this instance, the output would be `KC_A` `KC_X`.
### Permissive Hold
Expand Down Expand Up @@ -379,73 +375,6 @@ bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
}
```
## Ignore Mod Tap Interrupt
To enable this setting, add this to your `config.h`:
```c
#define IGNORE_MOD_TAP_INTERRUPT
```

?> This option affects only the Mod Tap keys; it does not affect other dual-role keys such as Layer Tap.

By default, the tap-or-hold decision for Mod Tap keys strongly prefers the hold action. If you press a Mod Tap key, then press another key while still holding the Mod Tap key down, the Mod Tap press will be handled as a modifier hold even if the Mod Tap key is then released within the tapping term, and irrespective of the order in which those keys are released. Using options such as `PERMISSIVE_HOLD` or `HOLD_ON_OTHER_KEY_PRESS` will not affect the functionality of Mod Tap keys in a major way (these options would still affect the delay until the common code for dual-role keys finishes its tap-or-hold decision, but then the special code for Mod Tap keys will override the result of that decision and choose the hold action if another key was pressed). In fact, by default, the tap-or-hold decision for Mod Tap keys is done in the same way as if the `HOLD_ON_OTHER_KEY_PRESS` option was enabled, but without the decreased delay provided by `HOLD_ON_OTHER_KEY_PRESS`.

If the `IGNORE_MOD_TAP_INTERRUPT` option is enabled, Mod Tap keys are no longer treated as a special case, and their behavior will match the behavior of other dual-role keys such as Layer Tap. Then the behavior of Mod Tap keys can be further tuned using other options such as `PERMISSIVE_HOLD` or `HOLD_ON_OTHER_KEY_PRESS`.

An example of a sequence that will be affected by the `IGNORE_MOD_TAP_INTERRUPT` option (assuming that options like `PERMISSIVE_HOLD` or `HOLD_ON_OTHER_KEY_PRESS` are not enabled):

- `SFT_T(KC_A)` Down
- `KC_X` Down
- `SFT_T(KC_A)` Up
- `KC_X` Up

```
TAPPING_TERM
+---------------------------|--------+
| +-------------+ | |
| | SFT_T(KC_A) | | |
| +-------------+ | |
| +--------------+ | |
| | KC_X | | |
| +--------------+ | |
+---------------------------|--------+
```

Normally, this would send a capital `X` (`SHIFT`+`x`), even if the sequence is performed faster than the `TAPPING_TERM`. However, if the `IGNORE_MOD_TAP_INTERRUPT` option is enabled, the `SFT_T(KC_A)` key must be held longer than the `TAPPING_TERM` to register the hold action. A quick tap will output `ax` in this case, while a hold will still output a capital `X` (`SHIFT`+`x`).

However, if the `HOLD_ON_OTHER_KEY_PRESS` option is enabled in addition to `IGNORE_MOD_TAP_INTERRUPT`, the above sequence will again send a capital `X` (`SHIFT`+`x`) even if performed faster than the `TAPPING_TERM`. The difference from the default configuration is that by default the host will receive the key events only after the `SFT_T(KC_A)` key is released, but with the `HOLD_ON_OTHER_KEY_PRESS` option, the host will start receiving key events when the `KC_X` key is pressed.

For more granular control of this feature, you can add the following to your `config.h`:

```c
#define HOLD_ON_OTHER_KEY_PRESS_PER_KEY
```

?> This option affects *all* dual-role keys.

You can then add the following function to your keymap:

```c
bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case SFT_T(KC_SPC):
// Do not force the mod-tap key press to be handled as a modifier
// if any other key was pressed while the mod-tap key is held down.
return false;
default:
// Force the dual-role key press to be handled as a modifier if any
// other key was pressed while the mod-tap key is held down.
return true;
}
}
```
Note that you must return `false` in `get_hold_on_other_key_press` in order to apply `IGNORE_MOD_TAP_INTERRUPT` for a certain mod-tap key.
?> `IGNORE_MOD_TAP_INTERRUPT[_PER_KEY]` is being progressively phased out to align the (default) behavior and configuration of mod-taps with the rest of dual-role keys.
## Quick Tap Term
When the user holds a key after tapping it, the tapping function is repeated by default, rather than activating the hold function. This allows keeping the ability to auto-repeat the tapping function of a dual-role key. `QUICK_TAP_TERM` enables fine tuning of that ability. If set to `0`, it will remove the auto-repeat ability and activate the hold function instead.
Expand Down
3 changes: 0 additions & 3 deletions keyboards/0xcb/splaytoraid/keymaps/pi/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

#define TAPPING_TERM 180

// Prevent normal rollover on alphas from accidentally triggering mods.
#define IGNORE_MOD_TAP_INTERRUPT

#undef LOCKING_SUPPORT_ENABLE
#undef LOCKING_RESYNC_ENABLE

Expand Down
1 change: 0 additions & 1 deletion keyboards/40percentclub/gherkin/keymaps/pierrec83/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@

#define TAPPING_TERM 200
#define PERMISSIVE_HOLD
#define IGNORE_MOD_TAP_INTERRUPT
#define QUICK_TAP_TERM 0
2 changes: 0 additions & 2 deletions keyboards/40percentclub/gherkin/keymaps/stevexyz/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

#define PERMISSIVE_HOLD
// makes tap and hold keys trigger the hold if another key is pressed before releasing, even if it hasn't hit the TAPPING_TERM
#define IGNORE_MOD_TAP_INTERRUPT
// makes it possible to do rolling combos (zx) with keys that convert to other keys on hold, by enforcing the TAPPING_TERM for both keys.

#define QUICK_TAP_TERM 0
// makes it possible to use a dual role key as modifier shortly after having been tapped (see Hold after tap)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
#pragma once

// place overrides here
#define IGNORE_MOD_TAP_INTERRUPT
#define PERMISSIVE_HOLD
#define TAPPING_TERM 200
2 changes: 0 additions & 2 deletions keyboards/40percentclub/nori/keymaps/wings_36key/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

#pragma once

#define IGNORE_MOD_TAP_INTERRUPT // MT key must be held longer than tapping term for
// modifer to be registered
#define RETRO_TAPPING_PER_KEY
#define TAPPING_TERM_PER_KEY

Expand Down
1 change: 0 additions & 1 deletion keyboards/atreus/keymaps/kejadlen/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#define DIODE_DIRECTION COL2ROW

#define IGNORE_MOD_TAP_INTERRUPT
#define QUICK_TAP_TERM 0

#define USB_MAX_POWER_CONSUMPTION 50
2 changes: 0 additions & 2 deletions keyboards/atreus/keymaps/khitsule/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include "../../config.h"

#define IGNORE_MOD_TAP_INTERRUPT

#endif
1 change: 0 additions & 1 deletion keyboards/atreus62/keymaps/hvp/config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once

#define TAPPING_TERM 150
#define IGNORE_MOD_TAP_INTERRUPT
#define PERMISSIVE_HOLD
1 change: 0 additions & 1 deletion keyboards/aya/keymaps/default/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@

#pragma once

#define IGNORE_MOD_TAP_INTERRUPT
1 change: 0 additions & 1 deletion keyboards/b_sides/rev41lp/keymaps/cyril/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#define TAPPING_TERM 150
#define TAPPING_TERM_PER_KEY
#define IGNORE_MOD_TAP_INTERRUPT
1 change: 0 additions & 1 deletion keyboards/b_sides/rev41lp/keymaps/namnlos/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#define BACKLIGHT_DEFAULT_LEVEL 3

#define COMBO_COUNT 3
#define IGNORE_MOD_TAP_INTERRUPT

#define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_WINDOWS, UNICODE_MODE_MACOS, UNICODE_MODE_LINUX

Expand Down
1 change: 0 additions & 1 deletion keyboards/bajjak/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define TAPPING_TOGGLE 1

#define TAPPING_TERM 200
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
Expand Down
1 change: 0 additions & 1 deletion keyboards/barracuda/keymaps/default/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@
#pragma once

#define TAPPING_TERM 175 // milliseconds
#define IGNORE_MOD_TAP_INTERRUPT
1 change: 0 additions & 1 deletion keyboards/barracuda/keymaps/via/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@
#pragma once

#define TAPPING_TERM 175 // milliseconds
#define IGNORE_MOD_TAP_INTERRUPT
Loading

0 comments on commit a4a5a2e

Please sign in to comment.