LUFA USB descriptor cleanup (#4871)
[jackhill/qmk/firmware.git] / docs / feature_key_lock.md
CommitLineData
c11a26ba 1# Key Lock
5fc4a664 2
c11a26ba 3Sometimes you may find yourself needing to hold down a specific key for a long period of time. Key Lock holds down the next key you press for you. Press it again, and it will be released.
5fc4a664 4
c11a26ba 5Let's say you need to type in ALL CAPS for a few sentences. Hit `KC_LOCK`, and then Shift. Now, Shift will be considered held until you tap it again. You can think of Key Lock as Caps Lock, but supercharged.
5fc4a664 6
c11a26ba 7## Usage
5fc4a664 8
c11a26ba 9First, enable Key Lock by setting `KEY_LOCK_ENABLE = yes` in your `rules.mk`. Then pick a key in your keymap and assign it the keycode `KC_LOCK`.
10
11## Keycodes
12
13|Keycode |Description |
14|---------|--------------------------------------------------------------|
15|`KC_LOCK`|Hold down the next key pressed, until the key is pressed again|
16
17## Caveats
18
19Key Lock is only able to hold standard action keys and [One Shot modifier](quantum_keycodes.md#one-shot-keys) keys (for example, if you have your Shift defined as `OSM(KC_LSFT)`).
20This does not include any of the QMK special functions (except One Shot modifiers), or shifted versions of keys such as `KC_LPRN`. If it's in the [Basic Keycodes](keycodes_basic.md) list, it can be held.
21
22Switching layers will not cancel the Key Lock.