Files
zsa_qmk_firmware/docs/feature_key_lock.md
T

24 lines
1.3 KiB
Markdown
Raw Normal View History

2018-08-01 11:07:50 +10:00
# Key Lock
2017-08-06 02:09:34 -07:00
2018-08-01 11:07:50 +10:00
Sometimes 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.
2017-08-06 02:09:34 -07:00
2022-10-22 01:46:10 +11:00
Let's say you need to type in ALL CAPS for a few sentences. Hit `QK_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.
2017-08-06 02:09:34 -07:00
2018-08-01 11:07:50 +10:00
## Usage
2017-08-06 02:09:34 -07:00
2022-10-22 01:46:10 +11:00
First, 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 `QK_LOCK`.
2018-08-01 11:07:50 +10:00
## Keycodes
|Keycode |Description |
|---------|--------------------------------------------------------------|
2022-10-22 01:46:10 +11:00
|`QK_LOCK`|Hold down the next key pressed, until the key is pressed again|
2018-08-01 11:07:50 +10:00
## Caveats
2022-10-24 23:29:23 +01:00
Key Lock is only able to hold standard action keys and [One Shot modifier](one_shot_keys.md) keys (for example, if you have your Shift defined as `OSM(MOD_LSFT)`).
2018-08-01 11:07:50 +10:00
This 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.
2021-11-29 00:17:07 -08:00
Switching layers will not cancel the Key Lock. The Key Lock can be cancelled by calling the `cancel_key_lock()` function.