summaryrefslogtreecommitdiff
path: root/docs/docs/behaviors/sticky-key.md
blob: e708576307d07909d1b8845532904711364e244c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
title: Sticky Key Behavior
sidebar_label: Sticky Key
---

## Summary

A sticky key stays pressed until another key is pressed. It is often used for 'sticky shift'. By using a sticky shift, you don't have to hold the shift key to write a capital.

By default, sticky keys stay pressed for a second if you don't press any other key. You can configure this with the `release-after-ms` setting (see below).

### Behavior Binding

- Reference: `&sk`
- Parameter #1: The keycode , e.g. `LSHIFT`

Example:

```
&sk LSHIFT
```

You can use any keycode that works for `&kp` as parameter to `&sk`:

```
&sk LG(LS(LA(LCTRL)))
```

### Configuration

You can configure a different `release-after-ms` in your keymap:

```
&sk {
    release-after-ms = <2000>;
};

/ {
    keymap {
        ...
    };
};
```

### Advanced usage

Sticky keys can be combined; if you tap `&sk LCTRL` and then `&sk LSHIFT` and then `&kp A`, the output will be ctrl+shift+a.

### Comparison to QMK

In QMK, sticky keys are known as 'one shot mods'.