2020-08-19 05:24:38 +10:00
|
|
|
---
|
2020-08-21 14:31:28 +10:00
|
|
|
title: Mod-Tap Behavior
|
|
|
|
sidebar_label: Mod-Tap
|
2020-08-19 05:24:38 +10:00
|
|
|
---
|
|
|
|
|
|
|
|
## Summary
|
|
|
|
|
2020-11-07 00:40:56 +11:00
|
|
|
The Mod-Tap behavior sends a different keypress, depending on whether it's held or tapped.
|
|
|
|
|
|
|
|
- If you hold the key for longer than 200ms, the first keycode ("mod") is sent.
|
|
|
|
- If you tap the key (release before 200ms), the second keycode ("tap") is sent.
|
2020-08-19 05:24:38 +10:00
|
|
|
|
2020-09-02 00:04:58 +10:00
|
|
|
If you press another key within the 200ms, the 'mod' behavior is also activated.
|
2020-08-19 05:24:38 +10:00
|
|
|
|
|
|
|
## Mod-Tap
|
|
|
|
|
|
|
|
The Mod-Tap behavior either acts as a held modifier, or as a tapped keycode.
|
|
|
|
|
|
|
|
### Behavior Binding
|
|
|
|
|
|
|
|
- Reference: `&mt`
|
2021-06-06 07:35:59 +10:00
|
|
|
- Parameter #1: The keycode to be sent when activating as a modifier, e.g. `LSHIFT`
|
2020-08-19 05:24:38 +10:00
|
|
|
- Parameter #2: The keycode to sent when used as a tap, e.g. `A`, `B`.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```
|
2021-06-06 07:35:59 +10:00
|
|
|
&mt LSHIFT A
|
2020-08-19 05:24:38 +10:00
|
|
|
```
|
2020-09-02 00:04:58 +10:00
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
You can configure a different tapping term in your keymap:
|
|
|
|
|
|
|
|
```
|
|
|
|
&mt {
|
2021-02-07 07:47:21 +11:00
|
|
|
tapping-term-ms = <400>;
|
2020-09-11 16:28:55 +10:00
|
|
|
};
|
2020-09-02 00:04:58 +10:00
|
|
|
|
|
|
|
/ {
|
|
|
|
keymap {
|
|
|
|
...
|
2021-05-20 01:10:29 +10:00
|
|
|
};
|
|
|
|
};
|
2020-09-02 00:04:58 +10:00
|
|
|
```
|
2020-11-07 00:40:56 +11:00
|
|
|
|
|
|
|
### Additional information
|
|
|
|
|
2021-08-13 09:52:11 +10:00
|
|
|
The mod-tap is a [hold-tap](hold-tap.md) under the hood with the "balanced" flavor and tapping-term-ms 200.
|