Skip to main content

Mod-Tap Behavior

Summary

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.

If you press another key within the 200ms, the 'mod' behavior is also activated.

Mod-Tap

The Mod-Tap behavior either acts as a held modifier, or as a tapped keycode.

Behavior Binding

  • Reference: &mt
  • Parameter #1: The keycode to be sent when activating as a modifier, e.g. LSHIFT
  • Parameter #2: The keycode to sent when used as a tap, e.g. A, B.

Example:

&mt LSHIFT A

Configuration

You can configure a different tapping term in your keymap:

&mt {
tapping-term-ms = <400>;
};

/ {
keymap {
...
};
};
info

Under the hood, the mod-tap is simply a hold-tap of the "hold-preferred" flavor with a tapping-term-ms of 200 that takes in two keypresses as its "hold" and "tap" parameters. This means that the mod-tap can be used to invoke any keycode, and is not limited to only activating modifier keys when it is held.

For users who want to momentarily access a specific layer while a key is held and send a keycode when the same key is tapped, see Layer-Tap.

Similarly, for users looking to create a keybind like the mod-tap that invokes behaviors other than keypresses, like sticky keys or key toggles, see Hold-Tap.