---
title: Tap and hold
description: Give one key a tap action and a different hold action.
---

A key can do one thing when tapped and another when held. The classic turns
<kbd>caps</kbd> into Escape on tap and Control on hold.

## In karabiner.ts

The upstream config wraps `toIfAlone` in a helper:

```ts utils/app.ts
export const tapModifier = (v: SideModifierAlias, to: ToEvent) =>
  map(v).to(toKey(v, undefined, { lazy: true })).toIfAlone(to)
```

## In Vimputer

Tap and Hold are moments on one binding, so there's no helper.

1. **Bind the key**

    Record <kbd>caps</kbd> as a binding's trigger.

2. **Add the moments**

    Under **Actions**, add a Tap moment with a **Shortcut** of <kbd>esc</kbd>, and
    a Hold moment with <kbd>⌃</kbd>.

3. **Set the hold time**

    Open Hold and drag its slider. This config uses 200 ms; untouched, Karabiner
    waits 500 ms.

In the Leader mode, <kbd>w</kbd> closes a tab (⌘W) on tap and reopens it (⌘⇧W)
on hold:

![The Leader layer, with separate Tap and Hold actions on W](/blume-assets/content/assets/screenshots/layer-leader.png)

To copy the helper's `{ lazy: true }`, put the modifier on Press instead of Hold
and turn on **Lazy modifier** under the Shortcut's **Key options…**. A lazy
modifier only applies once another key goes down. See
[Bindings](/docs/authoring/bindings#moments) for every moment.
