refactor(docs): Making the keymaps folder into a base folder

This commit is contained in:
Nicolas Munnich 2024-08-16 19:00:10 +02:00
parent 603421b888
commit 86fcf7f551
76 changed files with 389 additions and 516 deletions

View file

@ -17,11 +17,11 @@ There's been lots of various activity in ZMK land!
- [Nicell](https://github.com/Nicell) (nice!nano creator) contributed initial [RGB Underglow](/docs/features/underglow) ([#64](https://github.com/zmkfirmware/zmk/pull/64)) support to ZMK. - [Nicell](https://github.com/Nicell) (nice!nano creator) contributed initial [RGB Underglow](/docs/features/underglow) ([#64](https://github.com/zmkfirmware/zmk/pull/64)) support to ZMK.
- Tons of [documentation](/docs) work. - Tons of [documentation](/docs) work.
- Refactoring ([#73](https://github.com/zmkfirmware/zmk/pull/73), [#74](https://github.com/zmkfirmware/zmk/pull/74)) of [keymaps](/docs/features/keymaps) to make them simpler for users. - Refactoring ([#73](https://github.com/zmkfirmware/zmk/pull/73), [#74](https://github.com/zmkfirmware/zmk/pull/74)) of [keymaps](/docs/keymaps) to make them simpler for users.
- Mod-Tap Behavior (docs coming!) is much improved ([#69](https://github.com/zmkfirmware/zmk/pull/69)) and usable now. - Mod-Tap Behavior (docs coming!) is much improved ([#69](https://github.com/zmkfirmware/zmk/pull/69)) and usable now.
- An initial [`setup.sh`](/docs/user-setup#user-config-setup-script) script was created, allowing users to quickly bootstrap a "user config" setup and push it to GitHub, where GitHub Actions will build the firmware for you. - An initial [`setup.sh`](/docs/user-setup#user-config-setup-script) script was created, allowing users to quickly bootstrap a "user config" setup and push it to GitHub, where GitHub Actions will build the firmware for you.
- Corne shield ([#80](https://github.com/zmkfirmware/zmk/pull/80)) shield definition was added. - Corne shield ([#80](https://github.com/zmkfirmware/zmk/pull/80)) shield definition was added.
- Initial [encoder](/docs/features/encoders) support ([#61](https://github.com/zmkfirmware/zmk/pull/61)) was added. - Initial [encoder](/docs/keymaps/encoders) support ([#61](https://github.com/zmkfirmware/zmk/pull/61)) was added.
## Bugs and Showstoppers ## Bugs and Showstoppers

View file

@ -22,7 +22,7 @@ Tons of activity related to keymaps, so we'll go into more detail this time.
#### Codes Overhaul #### Codes Overhaul
[innovaker] _completely_ overhauled the set of available codes for keymaps, and simultaneously has created [innovaker] _completely_ overhauled the set of available codes for keymaps, and simultaneously has created
_beautiful_ [documentation](/docs/codes) to help users visualize the codes, and also understand if they are supported on their particular operating system. _beautiful_ [documentation](/docs/keymaps/list-of-codes) to help users visualize the codes, and also understand if they are supported on their particular operating system.
This also laid the foundation for the other keymap related changes that are now available. This also laid the foundation for the other keymap related changes that are now available.
@ -37,7 +37,7 @@ This also laid the foundation for the other keymap related changes that are now
which sends `Control + c` when pressed. This feature is often used on smaller keyboards to achieve "shifted keycodes", e.g. `LS(N1)` to send a `!`. which sends `Control + c` when pressed. This feature is often used on smaller keyboards to achieve "shifted keycodes", e.g. `LS(N1)` to send a `!`.
To make this easier, in addition to all the normal codes, we now have defines for common shifted codes, e.g. `EXCL` for `!`, `AT` for `@`, etc. To make this easier, in addition to all the normal codes, we now have defines for common shifted codes, e.g. `EXCL` for `!`, `AT` for `@`, etc.
To learn more, check out the [Modifiers](/docs/codes/modifiers) documentation. To learn more, check out the [Modifiers](/docs/keymaps/modifiers) documentation.
#### Simplified Key Press Behavior #### Simplified Key Press Behavior
@ -67,7 +67,7 @@ With this change, you can add
&ext_power EP_TOG &ext_power EP_TOG
``` ```
to toggle (on/off) the power to external hardware like RGB underglow or OLEDs. Check out the [external power control](/docs/behaviors/power#external-power-control) docs for more info. to toggle (on/off) the power to external hardware like RGB underglow or OLEDs. Check out the [external power control](/docs/keymaps/behaviors/power#external-power-control) docs for more info.
#### Deep Sleep #### Deep Sleep
@ -78,7 +78,7 @@ included some automatic power savings by switching to PORT events on the nRF52 c
#### Output Selection #### Output Selection
[joelspadin] added [output selection](/docs/behaviors/outputs) to allow selecting whether to send output over USB or BLE if both are connected. This should now help avoid having "double keypresses" when your keyboard is plugged into a host. [joelspadin] added [output selection](/docs/keymaps/behaviors/outputs) to allow selecting whether to send output over USB or BLE if both are connected. This should now help avoid having "double keypresses" when your keyboard is plugged into a host.
#### Bootloader Corruption Fix #### Bootloader Corruption Fix

View file

@ -21,7 +21,7 @@ Since last time, there have been several new powerful keymap features and behavi
#### Combos #### Combos
The initial [combos](/docs/features/combos) work has landed! The amazing [okke-formsma] has once again delivered another powerful feature for ZMK. Combos are "position based", and are configured in a new toplevel node next to they `keymap` node in user's keymap files. The initial [combos](/docs/keymaps/combos) work has landed! The amazing [okke-formsma] has once again delivered another powerful feature for ZMK. Combos are "position based", and are configured in a new toplevel node next to they `keymap` node in user's keymap files.
An example, that would send the `ESC` keycode when pressing both the first and second positions on your keyboard: An example, that would send the `ESC` keycode when pressing both the first and second positions on your keyboard:
@ -60,7 +60,7 @@ for a sticky layer.
#### `&to` Layer Behavior #### `&to` Layer Behavior
[mcrosson] contributed the new [`&to`](/docs/behaviors/layers#to-layer) layer related behavior. This can be used to completely replace the active layer with a new one. [mcrosson] contributed the new [`&to`](/docs/keymaps/behaviors/layers#to-layer) layer related behavior. This can be used to completely replace the active layer with a new one.
This is most frequently used when using multiple core base layers with different layouts, e.g. QWERTY and DVORAK, to switch between them. This is most frequently used when using multiple core base layers with different layouts, e.g. QWERTY and DVORAK, to switch between them.
@ -76,7 +76,7 @@ to your keymap will send `ESC` when pressed on its own, but will send `` ` `` wh
#### RGB Underglow Color Selection #### RGB Underglow Color Selection
[mcrosson] updated the [RGB Underglow behavior](/docs/behaviors/underglow) to allow [binding an explicit color selection](/docs/behaviors/underglow#examples) to a key position. [mcrosson] updated the [RGB Underglow behavior](/docs/keymaps/behaviors/underglow) to allow [binding an explicit color selection](/docs/keymaps/behaviors/underglow#examples) to a key position.
#### Keymap Upgrader #### Keymap Upgrader

View file

@ -21,16 +21,16 @@ Since last time, there have been several new powerful keymap features and behavi
#### Caps Word #### Caps Word
[petejohanson] added the [caps word](/docs/behaviors/caps-word) behavior, i.e. `&caps_word`, in [#823](https://github.com/zmkfirmware/zmk/pull/823) that allows toggling a mode where all all alpha characters are sent [petejohanson] added the [caps word](/docs/keymaps/behaviors/caps-word) behavior, i.e. `&caps_word`, in [#823](https://github.com/zmkfirmware/zmk/pull/823) that allows toggling a mode where all all alpha characters are sent
to the host capitalized until a non-alpha, non-"continue list" keycode is sent. This can be useful for typing things like `CONFIG_ENABLE_CAPS_WORD` without having to hold down shift. This is similar in spirit to using the caps lock key, but with the added benefit of turning itself off automatically. to the host capitalized until a non-alpha, non-"continue list" keycode is sent. This can be useful for typing things like `CONFIG_ENABLE_CAPS_WORD` without having to hold down shift. This is similar in spirit to using the caps lock key, but with the added benefit of turning itself off automatically.
#### Key Repeat #### Key Repeat
[petejohanson] added the new [key repeat](/docs/behaviors/key-repeat) behavior in [#1034](https://github.com/zmkfirmware/zmk/pull/1034) to allow repeating the last sent key-press again, including any modifiers that were applied to that key press. It can be added to your keymap using the simple `&key_repeat` reference. [petejohanson] added the new [key repeat](/docs/keymaps/behaviors/key-repeat) behavior in [#1034](https://github.com/zmkfirmware/zmk/pull/1034) to allow repeating the last sent key-press again, including any modifiers that were applied to that key press. It can be added to your keymap using the simple `&key_repeat` reference.
#### Macros #### Macros
[petejohanson], taking heavy inspiration on the initial work from [okke-formsma], added [macro support](/docs/behaviors/macros) in [#1168](https://github.com/zmkfirmware/zmk/pull/1166). Several [common patterns](/docs/behaviors/macros#common-patterns) are documented, but one example, changing the underglow color as you activate/deactivate a layer, looks like: [petejohanson], taking heavy inspiration on the initial work from [okke-formsma], added [macro support](/docs/keymaps/behaviors/macros) in [#1168](https://github.com/zmkfirmware/zmk/pull/1166). Several [common patterns](/docs/keymaps/behaviors/macros#common-patterns) are documented, but one example, changing the underglow color as you activate/deactivate a layer, looks like:
```dts ```dts
ZMK_MACRO(layer_color_macro, ZMK_MACRO(layer_color_macro,
@ -47,7 +47,7 @@ ZMK_MACRO(layer_color_macro,
#### Tap Dance #### Tap Dance
[kurtis-lew] worked diligently to add the [tap-dance behavior](/docs/behaviors/tap-dance) in [#1139](https://github.com/zmkfirmware/zmk/pull/1139), allowing different behaviors to be invoked based on the number of times [kurtis-lew] worked diligently to add the [tap-dance behavior](/docs/keymaps/behaviors/tap-dance) in [#1139](https://github.com/zmkfirmware/zmk/pull/1139), allowing different behaviors to be invoked based on the number of times
a user taps a single key in their keymap, e.g. a user taps a single key in their keymap, e.g.
```dts ```dts
@ -75,7 +75,7 @@ a user taps a single key in their keymap, e.g.
#### Conditional Layers #### Conditional Layers
[bcat] added [conditional layers](/docs/features/conditional-layers) in [#830](https://github.com/zmkfirmware/zmk/pull/830) as a generalized version of the common "adjust layer" pattern on smaller keyboards. [bcat] added [conditional layers](/docs/keymaps/conditional-layers) in [#830](https://github.com/zmkfirmware/zmk/pull/830) as a generalized version of the common "adjust layer" pattern on smaller keyboards.
Example: Example:
@ -93,23 +93,23 @@ Example:
#### Combos #### Combos
[mcrosson] added the [layer specific combos](https://zmk.dev/docs/features/combos#configuration) in [#661](https://github.com/zmkfirmware/zmk/pull/661), so users can make certain combos only triggerable when the layers set for the combo are active. [mcrosson] added the [layer specific combos](https://zmk.dev/docs/keymaps/combos#configuration) in [#661](https://github.com/zmkfirmware/zmk/pull/661), so users can make certain combos only triggerable when the layers set for the combo are active.
This is used by the [ZMK implementation](https://github.com/artseyio/zmk-artsey) of [ARTSEY](https://artsey.io/) extensively. This is used by the [ZMK implementation](https://github.com/artseyio/zmk-artsey) of [ARTSEY](https://artsey.io/) extensively.
#### Sticky Keys #### Sticky Keys
[okke-formsma] updated [sticky keys](/docs/behaviors/sticky-key) in [#1122](https://github.com/zmkfirmware/zmk/pull/1122) to add the `ignore-modifiers;` property; when set, sticky keys won't release when other modifiers are pressed. This allows you to combine sticky modifiers, which is popularly used with ["callum-style mods"](https://github.com/callum-oakley/qmk_firmware/tree/master/users/callum#oneshot-modifiers). [okke-formsma] updated [sticky keys](/docs/keymaps/behaviors/sticky-key) in [#1122](https://github.com/zmkfirmware/zmk/pull/1122) to add the `ignore-modifiers;` property; when set, sticky keys won't release when other modifiers are pressed. This allows you to combine sticky modifiers, which is popularly used with ["callum-style mods"](https://github.com/callum-oakley/qmk_firmware/tree/master/users/callum#oneshot-modifiers).
#### Hold-Tap Improvements #### Hold-Tap Improvements
[jmding8](https://github.com/jmding8) added an additional [positional hold-tap configuration](https://zmk.dev/docs/behaviors/hold-tap#positional-hold-tap-and-hold-trigger-key-positions) in [#835](https://github.com/zmkfirmware/zmk/pull/835) to help certain sequences produce the expected results. [jmding8](https://github.com/jmding8) added an additional [positional hold-tap configuration](https://zmk.dev/docs/keymaps/behaviors/hold-tap#positional-hold-tap-and-hold-trigger-key-positions) in [#835](https://github.com/zmkfirmware/zmk/pull/835) to help certain sequences produce the expected results.
[jmding8](https://github.com/jmding8) also added an additional [hold-tap flavor: `tap-unless-interrupted`](https://zmk.dev/docs/behaviors/hold-tap#flavors) in [#1018](https://github.com/zmkfirmware/zmk/pull/1018) which works very well with the new positional hold-tap config. [jmding8](https://github.com/jmding8) also added an additional [hold-tap flavor: `tap-unless-interrupted`](https://zmk.dev/docs/keymaps/behaviors/hold-tap#flavors) in [#1018](https://github.com/zmkfirmware/zmk/pull/1018) which works very well with the new positional hold-tap config.
[okke-formsma] implemented [`retro-tap` hold-tap property](https://zmk.dev/docs/behaviors/hold-tap#retro-tap) in [#667](https://github.com/zmkfirmware/zmk/pull/667) [okke-formsma] implemented [`retro-tap` hold-tap property](https://zmk.dev/docs/keymaps/behaviors/hold-tap#retro-tap) in [#667](https://github.com/zmkfirmware/zmk/pull/667)
[okke-formsma] _also_ added [`quick-tap-ms` hold-tap property](https://zmk.dev/docs/behaviors/hold-tap#quick-tap-ms) in [#655](https://github.com/zmkfirmware/zmk/pull/655) [okke-formsma] _also_ added [`quick-tap-ms` hold-tap property](https://zmk.dev/docs/keymaps/behaviors/hold-tap#quick-tap-ms) in [#655](https://github.com/zmkfirmware/zmk/pull/655)
### Apple Device Compatibility Improvements ### Apple Device Compatibility Improvements
@ -132,7 +132,7 @@ Another persistent bug that Apple users experienced was related to crashes and p
The long awaited locality enhancement was finally merged by [petejohanson] in [#547](https://github.com/zmkfirmware/zmk/pull/547), allowing more fine grained control of where certain behaviors are invoked. Some key improvements thanks to the changes: The long awaited locality enhancement was finally merged by [petejohanson] in [#547](https://github.com/zmkfirmware/zmk/pull/547), allowing more fine grained control of where certain behaviors are invoked. Some key improvements thanks to the changes:
- [RGB Underglow](/docs/features/underglow) behaviors now run globally, so enabling/disabling RGB, changing the color, animation, etc. applies to both sides of a split properly. - [RGB Underglow](/docs/features/underglow) behaviors now run globally, so enabling/disabling RGB, changing the color, animation, etc. applies to both sides of a split properly.
- [Reset](/docs/behaviors/reset#reset)/[Bootloader](/docs/behaviors/reset#bootloader-reset) behaviors now run wherever the key was pressed. For example, adding a `&bootloader` reference to the peripheral side of a split will now put that side of the split into the bootloader when pressed. - [Reset](/docs/keymaps/behaviors/reset#reset)/[Bootloader](/docs/keymaps/behaviors/reset#bootloader-reset) behaviors now run wherever the key was pressed. For example, adding a `&bootloader` reference to the peripheral side of a split will now put that side of the split into the bootloader when pressed.
#### Split Connections #### Split Connections

View file

@ -59,7 +59,7 @@ The day I was finally able to type on a wireless, split keyboard running ZMK was
## Onward and Upward ## Onward and Upward
We've come a long way since then, with our [supported hardware](/docs/hardware), [features](/docs/features/keymaps) and [behaviors](/docs/behaviors/key-press) growing regularly. We've come a long way since then, with our [supported hardware](/docs/hardware), [features](/docs/keymaps) and [behaviors](/docs/keymaps/behaviors/key-press) growing regularly.
ZMK powered keyboards are now available in group buys and in stock at various vendors; compatible controllers have been used in a wide range of builds to empower our users to free themselves from their USB/TRRS cables and move about untethered. ZMK powered keyboards are now available in group buys and in stock at various vendors; compatible controllers have been used in a wide range of builds to empower our users to free themselves from their USB/TRRS cables and move about untethered.

View file

@ -19,15 +19,15 @@ Here's a summary of the various major changes since last time, broken down by th
#### Hold-tap improvements #### Hold-tap improvements
[andrewjrae] added the [`require-prior-idle-ms` property](/docs/behaviors/hold-tap#require-prior-idle-ms) to the hold-tap behavior in [#1187](https://github.com/zmkfirmware/zmk/pull/1187) and [#1387](https://github.com/zmkfirmware/zmk/pull/1387), which prevents the hold behavior from triggering if it hasn't been a certain duration since the last key press. This is a useful feature to prevent accidental hold activations during quick typing and made its way into many keymaps! The same property was added to [combos](/docs/features/combos#configuration) as well to help prevent false combo activations. [andrewjrae] added the [`require-prior-idle-ms` property](/docs/keymaps/behaviors/hold-tap#require-prior-idle-ms) to the hold-tap behavior in [#1187](https://github.com/zmkfirmware/zmk/pull/1187) and [#1387](https://github.com/zmkfirmware/zmk/pull/1387), which prevents the hold behavior from triggering if it hasn't been a certain duration since the last key press. This is a useful feature to prevent accidental hold activations during quick typing and made its way into many keymaps! The same property was added to [combos](/docs/keymaps/combos#configuration) as well to help prevent false combo activations.
Note that an earlier iteration of this feature was supported with the `global-quick-tap` property, which did not allow customizing the timeout and used the value of `quick-tap-ms` for it. This property is now deprecated and users are encouraged to use `require-prior-idle-ms` instead. Note that an earlier iteration of this feature was supported with the `global-quick-tap` property, which did not allow customizing the timeout and used the value of `quick-tap-ms` for it. This property is now deprecated and users are encouraged to use `require-prior-idle-ms` instead.
[urob] added the [`hold-trigger-on-release` property](/docs/behaviors/hold-tap#positional-hold-tap-and-hold-trigger-key-positions) in [#1423](https://github.com/zmkfirmware/zmk/pull/1423). This significantly increases the usefulness of positional constraints on hold-taps, since it allows combining multiple holds such as different modifiers for home row mods usage. [urob] added the [`hold-trigger-on-release` property](/docs/keymaps/behaviors/hold-tap#positional-hold-tap-and-hold-trigger-key-positions) in [#1423](https://github.com/zmkfirmware/zmk/pull/1423). This significantly increases the usefulness of positional constraints on hold-taps, since it allows combining multiple holds such as different modifiers for home row mods usage.
#### Masking mods in mod-morphs #### Masking mods in mod-morphs
[aumuell](https://github.com/aumuell), [vrinek](https://github.com/vrinek) and [urob] contributed to improving the behavior of [mod-morphs](/docs/behaviors/mod-morph) by masking the triggering modifiers and added `keep-mods` property in [#1412](https://github.com/zmkfirmware/zmk/pull/1412). This unlocks more use cases for mod-morphs, since you are no longer constrained to emitting keycodes that work well with the triggering modifier keycodes. [aumuell](https://github.com/aumuell), [vrinek](https://github.com/vrinek) and [urob] contributed to improving the behavior of [mod-morphs](/docs/keymaps/behaviors/mod-morph) by masking the triggering modifiers and added `keep-mods` property in [#1412](https://github.com/zmkfirmware/zmk/pull/1412). This unlocks more use cases for mod-morphs, since you are no longer constrained to emitting keycodes that work well with the triggering modifier keycodes.
As an example, you can now define a mod-morph that swaps `;` and `:` so that the former is the shifted version of the latter, which wasn't previously possible: As an example, you can now define a mod-morph that swaps `;` and `:` so that the former is the shifted version of the latter, which wasn't previously possible:
@ -42,7 +42,7 @@ As an example, you can now define a mod-morph that swaps `;` and `:` so that the
#### Parameterized macros #### Parameterized macros
[petejohanson] added [macros that can be parameterized](/docs/behaviors/macros#parameterized-macros) with one or two parameters in [#1232](https://github.com/zmkfirmware/zmk/pull/1232). This allows users to define macros in a more modular way and is a nice quality-of-life improvement. [petejohanson] added [macros that can be parameterized](/docs/keymaps/behaviors/macros#parameterized-macros) with one or two parameters in [#1232](https://github.com/zmkfirmware/zmk/pull/1232). This allows users to define macros in a more modular way and is a nice quality-of-life improvement.
As a simple example, you could define a macro that puts any keycode provided between double quotes as below, then use it like `&ql A` in your keymap: As a simple example, you could define a macro that puts any keycode provided between double quotes as below, then use it like `&ql A` in your keymap:
@ -61,27 +61,27 @@ Please see the documentation page linked above for usage and more examples.
#### Arbitrary behaviors on encoder rotation #### Arbitrary behaviors on encoder rotation
[nickconway](https://github.com/nickconway) and [petejohanson] added [sensor rotation behaviors](/docs/behaviors/sensor-rotate) to allow invoking arbitrary behaviors from encoders [#1758](https://github.com/zmkfirmware/zmk/pull/1758). Previously encoder rotations could only invoke the key-press behavior `&kp` through the `&inc_dec_kp` binding, whereas now you can define new sensor rotation behaviors to invoke others. [nickconway](https://github.com/nickconway) and [petejohanson] added [sensor rotation behaviors](/docs/keymaps/behaviors/sensor-rotate) to allow invoking arbitrary behaviors from encoders [#1758](https://github.com/zmkfirmware/zmk/pull/1758). Previously encoder rotations could only invoke the key-press behavior `&kp` through the `&inc_dec_kp` binding, whereas now you can define new sensor rotation behaviors to invoke others.
(Note that currently behaviors that have "locality" such as `&rgb_ug` do not work as expected via encoder rotation bindings in split keyboards, due to issue [#1494](https://github.com/zmkfirmware/zmk/issues/1494).) (Note that currently behaviors that have "locality" such as `&rgb_ug` do not work as expected via encoder rotation bindings in split keyboards, due to issue [#1494](https://github.com/zmkfirmware/zmk/issues/1494).)
#### Pre-releasing already pressed keys #### Pre-releasing already pressed keys
[andrewjrae] contributed a tweak to emitting keycodes in [#1828](https://github.com/zmkfirmware/zmk/pull/1828), where rolling multiple keys that involve the same keycode now releases the keycode before sending a press event again. While this might sound like a technical distinction, it leads to more correct behavior when quickly typing sequences like `+=` and makes the [key repeat behavior](/docs/behaviors/key-repeat) work properly when it is pressed before the previous key is released. [andrewjrae] contributed a tweak to emitting keycodes in [#1828](https://github.com/zmkfirmware/zmk/pull/1828), where rolling multiple keys that involve the same keycode now releases the keycode before sending a press event again. While this might sound like a technical distinction, it leads to more correct behavior when quickly typing sequences like `+=` and makes the [key repeat behavior](/docs/keymaps/behaviors/key-repeat) work properly when it is pressed before the previous key is released.
#### Key toggle behavior #### Key toggle behavior
[cgoates](https://github.com/cgoates) added the [key toggle behavior](/docs/behaviors/key-toggle) in [#1278](https://github.com/zmkfirmware/zmk/pull/1278), which can be used via its `&kt` binding to toggle the state of a keycode between pressed and released. [cgoates](https://github.com/cgoates) added the [key toggle behavior](/docs/keymaps/behaviors/key-toggle) in [#1278](https://github.com/zmkfirmware/zmk/pull/1278), which can be used via its `&kt` binding to toggle the state of a keycode between pressed and released.
#### Apple Globe key #### Apple Globe key
[ReFil] added support for the `C_AC_NEXT_KEYBOARD_LAYOUT_SELECT` keycode with alias `GLOBE` which acts as the Globe key in macOS and iOS in [#1938](https://github.com/zmkfirmware/zmk/pull/1938). Note that this keycode doesn't exactly behave like a Globe key that is present on an Apple keyboard and its limitations are documented in [this comment](https://github.com/zmkfirmware/zmk/pull/1938#issuecomment-1744579039) thanks to testing by [SethMilliken](https://github.com/SethMilliken). These limitations will be noted in the official [keycodes documentation](/docs/codes/applications) shortly. [ReFil] added support for the `C_AC_NEXT_KEYBOARD_LAYOUT_SELECT` keycode with alias `GLOBE` which acts as the Globe key in macOS and iOS in [#1938](https://github.com/zmkfirmware/zmk/pull/1938). Note that this keycode doesn't exactly behave like a Globe key that is present on an Apple keyboard and its limitations are documented in [this comment](https://github.com/zmkfirmware/zmk/pull/1938#issuecomment-1744579039) thanks to testing by [SethMilliken](https://github.com/SethMilliken). These limitations will be noted in the official [keycodes documentation](/docs/keymaps/list-of-codes) shortly.
#### Bug fixes and other improvements #### Bug fixes and other improvements
[petejohanson], [andrewjrae] and [okke-formsma] tracked down and fixed an issue causing stuck keys when there are combos on key positions involving hold-tap behaviors in [#1411](https://github.com/zmkfirmware/zmk/pull/1411). This was an elusive bug that took a lot of effort from the community to nail down and fix! [petejohanson], [andrewjrae] and [okke-formsma] tracked down and fixed an issue causing stuck keys when there are combos on key positions involving hold-tap behaviors in [#1411](https://github.com/zmkfirmware/zmk/pull/1411). This was an elusive bug that took a lot of effort from the community to nail down and fix!
[nguyendown](https://github.com/nguyendown) and [joelspadin] tracked down and fixed a couple issues causing stuck keys with [sticky keys](/docs/behaviors/sticky-key) in [#1586](https://github.com/zmkfirmware/zmk/pull/1586), [#1745](https://github.com/zmkfirmware/zmk/pull/1745). [nguyendown](https://github.com/nguyendown) and [joelspadin] tracked down and fixed a couple issues causing stuck keys with [sticky keys](/docs/keymaps/behaviors/sticky-key) in [#1586](https://github.com/zmkfirmware/zmk/pull/1586), [#1745](https://github.com/zmkfirmware/zmk/pull/1745).
[okke-formsma] fixed an issue allowing tap dances to be invoked by combos in [#1518](https://github.com/zmkfirmware/zmk/pull/1518). [okke-formsma] fixed an issue allowing tap dances to be invoked by combos in [#1518](https://github.com/zmkfirmware/zmk/pull/1518).

View file

@ -33,12 +33,12 @@ _[Keymap Editor]_ is a web based graphical editor for ZMK keymaps. It provides a
## What can Keymap Editor do? ## What can Keymap Editor do?
- Render [devicetree keymaps](/docs/features/keymaps) using pre-defined, auto-generated, or side-loadable keyboard layouts - Render [devicetree keymaps](/docs/keymaps) using pre-defined, auto-generated, or side-loadable keyboard layouts
- Integrate with a GitHub repo to streamline firmware builds, or FileSystem/Clipboard if you'd still rather build locally - Integrate with a GitHub repo to streamline firmware builds, or FileSystem/Clipboard if you'd still rather build locally
- Edit [combos](/docs/features/combos), [behaviors](/docs/behaviors/key-press), [macros](/docs/behaviors/macros), [conditional layers](/docs/features/conditional-layers) and [rotary encoder bindings](/docs/behaviors/sensor-rotate) - Edit [combos](/docs/keymaps/combos), [behaviors](/docs/keymaps/behaviors/key-press), [macros](/docs/keymaps/behaviors/macros), [conditional layers](/docs/keymaps/conditional-layers) and [rotary encoder bindings](/docs/keymaps/behaviors/sensor-rotate)
- Manage references: moving a layer or renaming a behavior will look for references throughout your keymap and update them. - Manage references: moving a layer or renaming a behavior will look for references throughout your keymap and update them.
But check back regularly, because I update pretty often. A recent significant achievement was enabling [parameterized macros](/docs/behaviors/macros#parameterized-macros) and tying it in with my existing parameter type resolution so, yeah, you can finally create that reusable macro combining bluetooth profile selection with RGB backlight colour. Or use it for an actual useful thing, even. _(See also: [Using Parameterized Macros in Keymap Editor](https://github.com/nickcoutsos/keymap-editor/wiki/Using-Parameterized-Macros-in-Keymap-Editor))_ But check back regularly, because I update pretty often. A recent significant achievement was enabling [parameterized macros](/docs/keymaps/behaviors/macros#parameterized-macros) and tying it in with my existing parameter type resolution so, yeah, you can finally create that reusable macro combining bluetooth profile selection with RGB backlight colour. Or use it for an actual useful thing, even. _(See also: [Using Parameterized Macros in Keymap Editor](https://github.com/nickcoutsos/keymap-editor/wiki/Using-Parameterized-Macros-in-Keymap-Editor))_
My goals are, broadly: My goals are, broadly:

View file

@ -44,7 +44,7 @@ define a collection of nested _nodes_, whereas each node in turn specifies a var
_properties_ through which one can customize the keymap. _properties_ through which one can customize the keymap.
For example, the following snippet sets up a For example, the following snippet sets up a
[mod-morph](https://zmk.dev/docs/behaviors/mod-morph) behavior that sends <kbd>.</kbd> [mod-morph](https://zmk.dev/docs/keymaps/behaviors/mod-morph) behavior that sends <kbd>.</kbd>
("dot") when pressed by itself and sends <kbd>:</kbd> ("colon") when shifted: ("dot") when pressed by itself and sends <kbd>:</kbd> ("colon") when shifted:
```dts {6-7} showLineNumbers ```dts {6-7} showLineNumbers
@ -102,8 +102,8 @@ the helper macros, the actual size is instead reduced to a more sane 12 kB.[^1]
## Simplifying "Position-based" Behaviors ## Simplifying "Position-based" Behaviors
In ZMK, there are several features that are position-based. As of today, these In ZMK, there are several features that are position-based. As of today, these
are [combos](/docs/features/combos) and [positional are [combos](/docs/keymaps/combos) and [positional
hold-taps](/docs/behaviors/hold-tap#positional-hold-tap-and-hold-trigger-key-positions), hold-taps](/docs/keymaps/behaviors/hold-tap#positional-hold-tap-and-hold-trigger-key-positions),
with behaviors like the ["Swapper"](https://github.com/zmkfirmware/zmk/pull/1366) and [Leader with behaviors like the ["Swapper"](https://github.com/zmkfirmware/zmk/pull/1366) and [Leader
key](https://github.com/zmkfirmware/zmk/pull/1380) currently key](https://github.com/zmkfirmware/zmk/pull/1380) currently
developed by [Nick Conway](https://github.com/nickconway) in pull requests also utilizing them. developed by [Nick Conway](https://github.com/nickconway) in pull requests also utilizing them.

View file

@ -1,9 +0,0 @@
import Table from "@site/src/components/codes/Table";
## Application Controls
<Table group="application-controls" />
## Applications (Launch)
<Table group="applications" />

View file

@ -1,9 +0,0 @@
import Table from "@site/src/components/codes/Table";
## Cut, Copy, Paste
<Table group="cut-copy-paste" />
## Undo, Redo
<Table group="undo-redo" />

View file

@ -1,5 +0,0 @@
import Table from "@site/src/components/codes/Table";
## Input Assist
<Table group="input-assist" />

View file

@ -1,61 +0,0 @@
import Table from "@site/src/components/codes/Table";
## Keyboard
### Letters
<Table group="keyboard-letters" />
### Numbers
<Table group="keyboard-numbers" />
### Symbols / Punctuation
<Table group="keyboard-symbols" />
### Control & Whitespace
<Table group="keyboard-control-whitespace" />
### Navigation
<Table group="keyboard-navigation" />
### Modifiers
The [Modifiers](modifiers.mdx) page includes further information.
<Table group="keyboard-modifiers" />
### Locks
<Table group="keyboard-locks" />
### F Keys
<Table group="keyboard-fkeys" />
### International
<Table group="keyboard-international" />
### Language
<Table group="keyboard-language" />
### Miscellaneous
<Table group="keyboard-miscellaneous" />
## Keypad
<Table group="keypad" />
### Numbers
<Table group="keypad-numbers" />
### Symbols / Operations
<Table group="keypad-operations" />

View file

@ -1,21 +0,0 @@
import Table from "@site/src/components/codes/Table";
## Sound / Volume
<Table group="sound" />
## Display
<Table group="display" />
## Media Controls
<Table group="media-controls" />
## Consumer Menus
<Table group="consumer-menus" />
## Consumer Controls
<Table group="consumer-controls" />

View file

@ -1,5 +0,0 @@
import Table from "@site/src/components/codes/Table";
## Power & Lock
<Table group="power" />

View file

@ -1,17 +0,0 @@
---
title: Applications
sidebar_label: Applications
hide_title: true
---
import OsLegend from "@site/src/components/codes/OsLegend";
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
import Content, { toc as contentToc } from "./_applications.mdx";
import KeyboardConsumer from "./_keyboard-consumer.md";
export const toc = contentToc;
<KeyboardConsumer />
<OsLegend />
<ToastyContainer />
<Content />

View file

@ -1,17 +0,0 @@
---
title: Editing
sidebar_label: Editing
hide_title: true
---
import OsLegend from "@site/src/components/codes/OsLegend";
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
import Content, { toc as contentToc } from "./_editing.mdx";
import KeyboardConsumer from "./_keyboard-consumer.md";
export const toc = contentToc;
<KeyboardConsumer />
<OsLegend />
<ToastyContainer />
<Content />

View file

@ -1,40 +0,0 @@
---
title: Codes
sidebar_label: Full List
hide_title: true
slug: ./
---
import OsLegend from "@site/src/components/codes/OsLegend";
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
import Key, { toc as keyToc } from "./_keyboard-keypad.mdx";
import Editing, { toc as editingToc } from "./_editing.mdx";
import Media, { toc as mediaToc } from "./_media.mdx";
import Applications, { toc as applicationsToc } from "./_applications.mdx";
import InputAssist, { toc as inputAssistToc } from "./_input-assist.mdx";
import Power, { toc as powerToc } from "./_power.mdx";
import KeyboardConsumer from "./_keyboard-consumer.md";
export const toc = [
...keyToc,
...editingToc,
...mediaToc,
...applicationsToc,
...inputAssistToc,
...powerToc,
];
:::warning
Take extra notice of the spelling of the keycodes, especially the shorthand spelling.
Otherwise, it will result in an elusive parsing error!
:::
<KeyboardConsumer />
<OsLegend />
<ToastyContainer />
<Key />
<Editing />
<Media />
<Applications />
<InputAssist />
<Power />

View file

@ -1,15 +0,0 @@
---
title: Input Assist
sidebar_label: Input Assist
hide_title: true
---
import OsLegend from "@site/src/components/codes/OsLegend";
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
import Content, { toc as contentToc } from "./_input-assist.mdx";
export const toc = contentToc;
<OsLegend />
<ToastyContainer />
<Content />

View file

@ -1,15 +0,0 @@
---
title: Keyboard & Keypad
sidebar_label: Keyboard & Keypad
hide_title: true
---
import OsLegend from "@site/src/components/codes/OsLegend";
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
import Content, { toc as contentToc } from "./_keyboard-keypad.mdx";
export const toc = contentToc;
<OsLegend />
<ToastyContainer />
<Content />

View file

@ -1,17 +0,0 @@
---
title: Media
sidebar_label: Media
hide_title: true
---
import OsLegend from "@site/src/components/codes/OsLegend";
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
import Content, { toc as contentToc } from "./_media.mdx";
import KeyboardConsumer from "./_keyboard-consumer.md";
export const toc = contentToc;
<KeyboardConsumer />
<OsLegend />
<ToastyContainer />
<Content />

View file

@ -1,17 +0,0 @@
---
title: Power
sidebar_label: Power
hide_title: true
---
import OsLegend from "@site/src/components/codes/OsLegend";
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
import Content, { toc as contentToc } from "./_power.mdx";
import KeyboardConsumer from "./_keyboard-consumer.md";
export const toc = contentToc;
<KeyboardConsumer />
<OsLegend />
<ToastyContainer />
<Content />

View file

@ -21,7 +21,7 @@ Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/
| `CONFIG_ZMK_BACKLIGHT_AUTO_OFF_USB` | bool | Turn off backlight when USB is disconnected | n | | `CONFIG_ZMK_BACKLIGHT_AUTO_OFF_USB` | bool | Turn off backlight when USB is disconnected | n |
:::note :::note
The `*_START` settings only determine the initial backlight state. Any changes you make with the [backlight behavior](../behaviors/backlight.md) are saved to flash after a one minute delay and will be used after that. The `*_START` settings only determine the initial backlight state. Any changes you make with the [backlight behavior](../keymaps/behaviors/backlight.md) are saved to flash after a one minute delay and will be used after that.
::: :::
## Devicetree ## Devicetree

View file

@ -21,7 +21,7 @@ See the [zmk/app/dts/behaviors/](https://github.com/zmkfirmware/zmk/tree/main/ap
Creates a custom behavior that behaves similar to a caps lock but deactivates when any key not in a continue list is pressed. Creates a custom behavior that behaves similar to a caps lock but deactivates when any key not in a continue list is pressed.
See the [caps word behavior](../behaviors/caps-word.md) documentation for more details and examples. See the [caps word behavior](../keymaps/behaviors/caps-word.md) documentation for more details and examples.
### Devicetree ### Devicetree
@ -30,9 +30,9 @@ Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-caps-word.yaml](ht
Applies to: `compatible = "zmk,behavior-caps-word"` Applies to: `compatible = "zmk,behavior-caps-word"`
| Property | Type | Description | Default | | Property | Type | Description | Default |
| ---------------- | ----- | ------------------------------------------------------------------ | ------------------------------- | | ---------------- | ----- | ---------------------------------------------------------------------------------- | ------------------------------- |
| `#binding-cells` | int | Must be `<0>` | | | `#binding-cells` | int | Must be `<0>` | |
| `continue-list` | array | List of [key codes](/docs/codes) which do not deactivate caps lock | `<UNDERSCORE BACKSPACE DELETE>` | | `continue-list` | array | List of [key codes](/docs/keymaps/list-of-codes) which do not deactivate caps lock | `<UNDERSCORE BACKSPACE DELETE>` |
| `mods` | int | A bit field of modifiers to apply | `<MOD_LSFT>` | | `mods` | int | A bit field of modifiers to apply | `<MOD_LSFT>` |
`continue-list` is treated as if it always includes alphanumeric characters (A-Z, 0-9). `continue-list` is treated as if it always includes alphanumeric characters (A-Z, 0-9).
@ -42,14 +42,14 @@ See [dt-bindings/zmk/modifiers.h](https://github.com/zmkfirmware/zmk/blob/main/a
You can use the following nodes to tweak the default behaviors: You can use the following nodes to tweak the default behaviors:
| Node | Behavior | | Node | Behavior |
| ------------ | -------------------------------------- | | ------------ | ---------------------------------------------- |
| `&caps_word` | [Caps Word](../behaviors/caps-word.md) | | `&caps_word` | [Caps Word](../keymaps/behaviors/caps-word.md) |
## Hold-Tap ## Hold-Tap
Creates a custom behavior that triggers one behavior when a key is held or a different one when the key is tapped. Creates a custom behavior that triggers one behavior when a key is held or a different one when the key is tapped.
See the [hold-tap behavior](../behaviors/hold-tap.mdx) documentation for more details and examples. See the [hold-tap behavior](../keymaps/behaviors/hold-tap.mdx) documentation for more details and examples.
### Kconfig ### Kconfig
@ -86,22 +86,22 @@ The `flavor` property may be one of:
- `"tap-preferred"` - `"tap-preferred"`
- `"tap-unless-interrupted"` - `"tap-unless-interrupted"`
See the [hold-tap behavior documentation](../behaviors/hold-tap.mdx) for an explanation of each flavor. See the [hold-tap behavior documentation](../keymaps/behaviors/hold-tap.mdx) for an explanation of each flavor.
`hold-trigger-key-positions` is an array of zero-based key position indices. `hold-trigger-key-positions` is an array of zero-based key position indices.
You can use the following nodes to tweak the default behaviors: You can use the following nodes to tweak the default behaviors:
| Node | Behavior | | Node | Behavior |
| ----- | --------------------------------------------- | | ----- | ----------------------------------------------------- |
| `&lt` | [Layer-tap](../behaviors/layers.md#layer-tap) | | `&lt` | [Layer-tap](../keymaps/behaviors/layers.md#layer-tap) |
| `&mt` | [Mod-tap](../behaviors/mod-tap.md) | | `&mt` | [Mod-tap](../keymaps/behaviors/mod-tap.md) |
## Key Repeat ## Key Repeat
Creates a custom behavior that repeats the whatever key code was last sent. Creates a custom behavior that repeats the whatever key code was last sent.
See the [key repeat behavior](../behaviors/key-repeat.md) documentation for more details and examples. See the [key repeat behavior](../keymaps/behaviors/key-repeat.md) documentation for more details and examples.
### Devicetree ### Devicetree
@ -119,14 +119,14 @@ For the `usage-pages` property, use the `HID_USAGE_*` defines from [dt-bindings/
You can use the following nodes to tweak the default behaviors: You can use the following nodes to tweak the default behaviors:
| Node | Behavior | | Node | Behavior |
| ------------- | ---------------------------------------- | | ------------- | ------------------------------------------------ |
| `&key_repeat` | [Key repeat](../behaviors/key-repeat.md) | | `&key_repeat` | [Key repeat](../keymaps/behaviors/key-repeat.md) |
## Macro ## Macro
Creates a custom behavior which triggers a sequence of other behaviors. Creates a custom behavior which triggers a sequence of other behaviors.
See the [macro behavior](../behaviors/macros.md) documentation for more details and examples. See the [macro behavior](../keymaps/behaviors/macros.md) documentation for more details and examples.
### Kconfig ### Kconfig
@ -174,7 +174,7 @@ The following macro-specific behaviors can be added at any point in the `binding
Creates a custom behavior that triggers one of two behaviors depending on whether certain modifiers are held. Creates a custom behavior that triggers one of two behaviors depending on whether certain modifiers are held.
See the [mod-morph behavior](../behaviors/mod-morph.md) documentation for more details and examples. See the [mod-morph behavior](../keymaps/behaviors/mod-morph.md) documentation for more details and examples.
### Devicetree ### Devicetree
@ -193,15 +193,15 @@ See [dt-bindings/zmk/modifiers.h](https://github.com/zmkfirmware/zmk/blob/main/a
You can use the following nodes to tweak the default behaviors: You can use the following nodes to tweak the default behaviors:
| Node | Behavior | | Node | Behavior |
| -------- | ----------------------------------------- | | -------- | ------------------------------------------------- |
| `&gresc` | [Grave escape](../behaviors/mod-morph.md) | | `&gresc` | [Grave escape](../keymaps/behaviors/mod-morph.md) |
## Sensor Rotation ## Sensor Rotation
Creates a custom behavior which sends a tap of other behaviors when a sensor is rotated. Creates a custom behavior which sends a tap of other behaviors when a sensor is rotated.
Has two variants: with `compatible = "zmk,behavior-sensor-rotate"` it accepts no parameters when used, whereas with `compatible = "zmk,behavior-sensor-rotate-var"` it accepts two parameters. Has two variants: with `compatible = "zmk,behavior-sensor-rotate"` it accepts no parameters when used, whereas with `compatible = "zmk,behavior-sensor-rotate-var"` it accepts two parameters.
See the [sensor rotation behavior](../behaviors/sensor-rotate.md) documentation for more details and examples. See the [sensor rotation behavior](../keymaps/behaviors/sensor-rotate.md) documentation for more details and examples.
### Devicetree ### Devicetree
@ -232,7 +232,7 @@ With `compatible = "zmk,behavior-sensor-rotate-var"`, this behavior forwards the
Creates a custom behavior that triggers a behavior and keeps it pressed it until another key is pressed and released. Creates a custom behavior that triggers a behavior and keeps it pressed it until another key is pressed and released.
See the [sticky key behavior](../behaviors/sticky-key.md) and [sticky layer behavior](../behaviors/sticky-layer.md) documentation for more details and examples. See the [sticky key behavior](../keymaps/behaviors/sticky-key.md) and [sticky layer behavior](../keymaps/behaviors/sticky-layer.md) documentation for more details and examples.
### Kconfig ### Kconfig
@ -260,15 +260,15 @@ This behavior forwards the one parameter it receives to the parameter of the beh
You can use the following nodes to tweak the default behaviors: You can use the following nodes to tweak the default behaviors:
| Node | Behavior | | Node | Behavior |
| ----- | -------------------------------------------- | | ----- | ---------------------------------------------------- |
| `&sk` | [Sticky key](../behaviors/sticky-key.md) | | `&sk` | [Sticky key](../keymaps/behaviors/sticky-key.md) |
| `&sl` | [Sticky layer](../behaviors/sticky-layer.md) | | `&sl` | [Sticky layer](../keymaps/behaviors/sticky-layer.md) |
## Tap Dance ## Tap Dance
Creates a custom behavior that triggers a different behavior corresponding to the number of times the key is tapped. Creates a custom behavior that triggers a different behavior corresponding to the number of times the key is tapped.
See the [tap dance behavior](../behaviors/tap-dance.mdx) documentation for more details and examples. See the [tap dance behavior](../keymaps/behaviors/tap-dance.mdx) documentation for more details and examples.
### Devicetree ### Devicetree

View file

@ -3,7 +3,7 @@ title: Combo Configuration
sidebar_label: Combos sidebar_label: Combos
--- ---
See the [Combos feature page](../features/combos.md) for more details and examples. See the [Combos informational page](../keymaps/combos.md) for more details and examples.
See [Configuration Overview](index.md) for instructions on how to change these settings. See [Configuration Overview](index.md) for instructions on how to change these settings.
@ -33,7 +33,7 @@ Each child node can have the following properties:
| Property | Type | Description | Default | | Property | Type | Description | Default |
| ----------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------- | | ----------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| `bindings` | phandle-array | A [behavior](../features/keymaps.mdx#behaviors) to run when the combo is triggered | | | `bindings` | phandle-array | A [behavior](../keymaps/index.mdx#behaviors) to run when the combo is triggered | |
| `key-positions` | array | A list of key position indices for the keys which should trigger the combo | | | `key-positions` | array | A list of key position indices for the keys which should trigger the combo | |
| `timeout-ms` | int | All the keys in `key-positions` must be pressed within this time in milliseconds to trigger the combo | 50 | | `timeout-ms` | int | All the keys in `key-positions` must be pressed within this time in milliseconds to trigger the combo | 50 |
| `require-prior-idle-ms` | int | If any non-modifier key is pressed within `require-prior-idle-ms` before a key in the combo, the key will not be considered for the combo | -1 (disabled) | | `require-prior-idle-ms` | int | If any non-modifier key is pressed within `require-prior-idle-ms` before a key in the combo, the key will not be considered for the combo | -1 (disabled) |

View file

@ -3,7 +3,7 @@ title: Encoder Configuration
sidebar_label: Encoders sidebar_label: Encoders
--- ---
See the [Encoders feature page](../features/encoders.md) for more details, including instructions for adding encoder support to a board. See the [Encoders informational page](../keymaps/encoders.md) for more details, including instructions for adding encoder support to a board.
See [Configuration Overview](index.md) for instructions on how to change these settings. See [Configuration Overview](index.md) for instructions on how to change these settings.

View file

@ -18,9 +18,9 @@ The `zmk,keymap` node itself has no properties. It should have one child node pe
Each child node can have the following properties: Each child node can have the following properties:
| Property | Type | Description | | Property | Type | Description |
| ----------------- | ------------- | ----------------------------------------------------------------------- | | ----------------- | ------------- | -------------------------------------------------------------------- |
| `display-name` | string | Name for the layer on displays | | `display-name` | string | Name for the layer on displays |
| `bindings` | phandle-array | List of [key behaviors](../features/keymaps.mdx#behaviors), one per key | | `bindings` | phandle-array | List of [key behaviors](../keymaps/index.mdx#behaviors), one per key |
| `sensor-bindings` | phandle-array | List of sensor behaviors, one per sensor | | `sensor-bindings` | phandle-array | List of sensor behaviors, one per sensor |
Items for `bindings` must be listed in the order the keys are defined in the [keyboard scan configuration](kscan.md). Items for `bindings` must be listed in the order the keys are defined in the [keyboard scan configuration](kscan.md).

View file

@ -26,7 +26,7 @@ Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/
## Soft Off ## Soft Off
The [soft off feature](../features/soft-off.md) allows turning the keyboard on/off from either dedicated hardware, or using the [`&soft_off` behavior](../behaviors/soft-off.md) to turn off and a reset button to turn back on again. The [soft off feature](../features/soft-off.md) allows turning the keyboard on/off from either dedicated hardware, or using the [`&soft_off` behavior](../keymaps/behaviors/soft-off.md) to turn off and a reset button to turn back on again.
### Kconfig ### Kconfig
@ -38,7 +38,7 @@ Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/
## External Power Control ## External Power Control
Driver for enabling or disabling power to peripherals such as displays and lighting. This driver must be configured to use [power management behaviors](../behaviors/power.md). Driver for enabling or disabling power to peripherals such as displays and lighting. This driver must be configured to use [power management behaviors](../keymaps/behaviors/power.md).
### Kconfig ### Kconfig

View file

@ -41,7 +41,7 @@ Values for `CONFIG_ZMK_RGB_UNDERGLOW_EFF_START`:
| 3 | Swirl | | 3 | Swirl |
:::note :::note
The `*_START` settings only determine the initial underglow state. Any changes you make with the [underglow behavior](../behaviors/underglow.md) are saved to flash after a one minute delay and will be used after that. The `*_START` settings only determine the initial underglow state. Any changes you make with the [underglow behavior](../keymaps/behaviors/underglow.md) are saved to flash after a one minute delay and will be used after that.
::: :::
## Devicetree ## Devicetree

View file

@ -28,7 +28,7 @@ Refer to the [Configuration](/docs/config) documentation for more details on thi
## Keymap ## Keymap
Once you have the basic user config completed, you can find the keymap file in `config/<keyboard>.keymap` and customize from there. Once you have the basic user config completed, you can find the keymap file in `config/<keyboard>.keymap` and customize from there.
Refer to the [Keymap](features/keymaps.mdx) documentation to learn more. Refer to the [Keymap](keymaps/index.mdx) documentation to learn more.
## Publishing ## Publishing

View file

@ -8,9 +8,9 @@ import TabItem from "@theme/TabItem";
## Overview ## Overview
This document outlines how to develop a [behavior](../behaviors/index.mdx) for ZMK and prepare the changes for a pull request. This document outlines how to develop a [behavior](../keymaps/behaviors/index.mdx) for ZMK and prepare the changes for a pull request.
Behaviors are assigned to key positions and determine what happens when they are pressed and released. They are implemented in Zephyr as "devices": they consist of a devicetree binding file, which specifies the properties of the behavior, and a driver written in C code. This allows for the ability to create unique instances of these behaviors in [keymaps](../features/keymaps.mdx) or devicetree-source-include files (`.dtsi`). While instances of behaviors stored in keymaps are created by end-users for their personal needs, the instances that live in the .dtsi files are stored and documented in ZMK directly, which removes the need for end-users to set up common use-cases of these behaviors in their personal keymaps. Behaviors are assigned to key positions and determine what happens when they are pressed and released. They are implemented in Zephyr as "devices": they consist of a devicetree binding file, which specifies the properties of the behavior, and a driver written in C code. This allows for the ability to create unique instances of these behaviors in [keymaps](../keymaps/index.mdx) or devicetree-source-include files (`.dtsi`). While instances of behaviors stored in keymaps are created by end-users for their personal needs, the instances that live in the .dtsi files are stored and documented in ZMK directly, which removes the need for end-users to set up common use-cases of these behaviors in their personal keymaps.
The general process for developing behaviors is: The general process for developing behaviors is:
@ -291,8 +291,8 @@ Comes in the form `static const struct behavior_driver_api <behavior_name>_drive
- `.binding_released`: Same as above, except for activating on keybind release events. Set `.binding_released` equal to the function typically named [`on_<behavior_name>_binding_released`](#dependencies). - `.binding_released`: Same as above, except for activating on keybind release events. Set `.binding_released` equal to the function typically named [`on_<behavior_name>_binding_released`](#dependencies).
- `.locality`: Defined in `<drivers/behavior.h>`. Describes how the behavior affects parts of a _split_ keyboard. - `.locality`: Defined in `<drivers/behavior.h>`. Describes how the behavior affects parts of a _split_ keyboard.
- `BEHAVIOR_LOCALITY_CENTRAL`: Behavior only affects the central half, which is the case for most keymap-related behavior. - `BEHAVIOR_LOCALITY_CENTRAL`: Behavior only affects the central half, which is the case for most keymap-related behavior.
- `BEHAVIOR_LOCALITY_EVENT_SOURCE`: Behavior affects only the central _or_ peripheral half depending on which side invoked the behavior binding, such as [reset behaviors](../behaviors/reset.md). - `BEHAVIOR_LOCALITY_EVENT_SOURCE`: Behavior affects only the central _or_ peripheral half depending on which side invoked the behavior binding, such as [reset behaviors](../keymaps/behaviors/reset.md).
- `BEHAVIOR_LOCALITY_GLOBAL`: Behavior affects the entire keyboard, such as [external power](../behaviors/power.md) and lighting-related behaviors that need to be synchronized across halves. - `BEHAVIOR_LOCALITY_GLOBAL`: Behavior affects the entire keyboard, such as [external power](../keymaps/behaviors/power.md) and lighting-related behaviors that need to be synchronized across halves.
:::note :::note
For unibody keyboards, all locality values perform the same as `BEHAVIOR_LOCALITY_GLOBAL`. For unibody keyboards, all locality values perform the same as `BEHAVIOR_LOCALITY_GLOBAL`.
::: :::
@ -444,7 +444,7 @@ Consider the following prompts when writing documentation for new behaviors:
- What does it do? Describe some general use-cases for the behavior. - What does it do? Describe some general use-cases for the behavior.
- Which properties included in the [devicetree binding](#creating-the-devicetree-binding-yaml) should be configured manually by the user? What do they do, and if applicable, what are their default values? - Which properties included in the [devicetree binding](#creating-the-devicetree-binding-yaml) should be configured manually by the user? What do they do, and if applicable, what are their default values?
- What does an example implementation in a keymap look like? Include a code-snippet of the example implementation in the keymap file's `behaviors` node. - What does an example implementation in a keymap look like? Include a code-snippet of the example implementation in the keymap file's `behaviors` node.
- Are there any [common use-cases of the behavior](#defining-common-use-cases-for-the-behavior-dtsi-optional)? Consider making a separate documentation page for these predefined variations, like how the [mod-tap](../behaviors/mod-tap.md) has a separate page from the [hold-tap](../behaviors/hold-tap.mdx). - Are there any [common use-cases of the behavior](#defining-common-use-cases-for-the-behavior-dtsi-optional)? Consider making a separate documentation page for these predefined variations, like how the [mod-tap](../keymaps/behaviors/mod-tap.md) has a separate page from the [hold-tap](../keymaps/behaviors/hold-tap.mdx).
- How does the behavior perform in edge cases? For example, tap-dances invoke the last binding in its list of `bindings` once the maximum number of keypresses has been reached. - How does the behavior perform in edge cases? For example, tap-dances invoke the last binding in its list of `bindings` once the maximum number of keypresses has been reached.
Consider also including visual aids alongside written documentation if it adds clarity. Consider also including visual aids alongside written documentation if it adds clarity.

View file

@ -443,7 +443,7 @@ The two `#include` lines at the top of the keymap are required in order to bring
### Keymap Behaviors ### Keymap Behaviors
For documentation on the available behaviors for use in keymaps, see the [overview page for behaviors](../behaviors/index.mdx). For documentation on the available behaviors for use in keymaps, see the [overview page for behaviors](../keymaps/behaviors/index.mdx).
## Metadata ## Metadata
@ -591,7 +591,7 @@ Add the following line to your keymap file to add default encoder behavior bindi
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
``` ```
Add additional bindings as necessary to match the default number of encoders on your board. See the [Encoders](../features/encoders.md) and [Keymap](../features/keymaps.mdx) feature documentation for more details. Add additional bindings as necessary to match the default number of encoders on your board. See the [Encoders](../keymaps/encoders.md) and [Keymap](../keymaps/index.mdx) feature documentation for more details.
</TabItem> </TabItem>
</Tabs> </Tabs>

View file

@ -24,7 +24,7 @@ device should receive the keyboard input.
:::note[Connection Management] :::note[Connection Management]
When pairing to a host device ZMK saves bond information to the selected profile. It will not replace this automatically when you initiate pairing with another device. To pair with a new device select an unused profile with or clearing the current profile, using the [`&bt` behavior](../behaviors/bluetooth.md) on your keyboard. When pairing to a host device ZMK saves bond information to the selected profile. It will not replace this automatically when you initiate pairing with another device. To pair with a new device select an unused profile with or clearing the current profile, using the [`&bt` behavior](../keymaps/behaviors/bluetooth.md) on your keyboard.
A ZMK device may show as "connected" on multiple hosts at the same time. This is working as intended, and only the host associated with the active profile will receive keystrokes. A ZMK device may show as "connected" on multiple hosts at the same time. This is working as intended, and only the host associated with the active profile will receive keystrokes.
@ -34,7 +34,7 @@ Failure to manage the profiles can result in unexpected/broken behavior with hos
## Bluetooth Behavior ## Bluetooth Behavior
Management of the bluetooth in ZMK is accomplished using the [`&bt` behavior](../behaviors/bluetooth.md). Be sure to refer to that documentation to learn how to manage profiles, switch between connected hosts, etc. Management of the bluetooth in ZMK is accomplished using the [`&bt` behavior](../keymaps/behaviors/bluetooth.md). Be sure to refer to that documentation to learn how to manage profiles, switch between connected hosts, etc.
## Refreshing the HID Descriptor ## Refreshing the HID Descriptor
@ -43,7 +43,7 @@ This in turn requires [HID report descriptors](https://docs.kernel.org/hid/hidin
Firmware changes that would modify the descriptor include the following: Firmware changes that would modify the descriptor include the following:
- Changing any of the settings under the [HID category](../config/system.md#hid), including enabling/disabling NKRO or HID indicators - Changing any of the settings under the [HID category](../config/system.md#hid), including enabling/disabling NKRO or HID indicators
- Enabling mouse features, such as adding [mouse keys](../behaviors/mouse-emulation.md) to your keymap - Enabling mouse features, such as adding [mouse keys](../keymaps/behaviors/mouse-emulation.md) to your keymap
While the descriptor refresh happens on boot for USB, hosts will frequently cache this descriptor for BLE devices. While the descriptor refresh happens on boot for USB, hosts will frequently cache this descriptor for BLE devices.
In order to refresh this cache, you need to remove the keyboard from the host device, clear the profile associated with the host on the keyboard, then pair again. In order to refresh this cache, you need to remove the keyboard from the host device, clear the profile associated with the host on the keyboard, then pair again.

View file

@ -6,5 +6,5 @@ sidebar_label: Displays
Displays in ZMK are currently a proof of concept and official support is coming soon. Displays in ZMK are currently a proof of concept and official support is coming soon.
:::info :::info
Although ZMK-powered keyboards _are_ capable of utilizing OLED and ePaper displays, the Displays feature is not yet considered production-ready due to an issue where the display remains blank after resuming from [external power cutoff](../behaviors/power.md#external-power-control). This issue can be tracked on GitHub at [zmkfirmware/zmk #674](https://github.com/zmkfirmware/zmk/issues/674). Although ZMK-powered keyboards _are_ capable of utilizing OLED and ePaper displays, the Displays feature is not yet considered production-ready due to an issue where the display remains blank after resuming from [external power cutoff](../keymaps/behaviors/power.md#external-power-control). This issue can be tracked on GitHub at [zmkfirmware/zmk #674](https://github.com/zmkfirmware/zmk/issues/674).
::: :::

View file

@ -24,7 +24,7 @@ Refer to the [soft off config](../config/power.md#soft-off) for details on enabl
## Soft Off With Existing Designs ## Soft Off With Existing Designs
For existing designs, using soft off is as simple as placing the [Soft Off Behavior](../behaviors/soft-off.md) in your keymap and then invoking it. For existing designs, using soft off is as simple as placing the [Soft Off Behavior](../keymaps/behaviors/soft-off.md) in your keymap and then invoking it.
You can then wake up the keyboard by pressing the reset button once, and repeating this for each side for split keyboards. You can then wake up the keyboard by pressing the reset button once, and repeating this for each side for split keyboards.
@ -83,7 +83,7 @@ GPIO keys are defined using child nodes under the `gpio-keys` compatible node. E
### Soft Off Behavior Instance ### Soft Off Behavior Instance
To use the [soft off behavior](../behaviors/soft-off.md) outside of a keymap, add an instance of the behavior to your `.overlay`/`.dts` file: To use the [soft off behavior](../keymaps/behaviors/soft-off.md) outside of a keymap, add an instance of the behavior to your `.overlay`/`.dts` file:
``` ```
/ { / {
@ -99,7 +99,7 @@ To use the [soft off behavior](../behaviors/soft-off.md) outside of a keymap, ad
### KScan Sideband Behavior ### KScan Sideband Behavior
The kscan sideband behavior driver will be used to trigger the [soft off behavior](../behaviors/soft-off.md) "out of band" from the normal keymap processing. To do so, it will decorate/wrap an underlying kscan driver. What kscan driver will vary for simple direct pin vs. matrix-integrated hardware combo. The kscan sideband behavior driver will be used to trigger the [soft off behavior](../keymaps/behaviors/soft-off.md) "out of band" from the normal keymap processing. To do so, it will decorate/wrap an underlying kscan driver. What kscan driver will vary for simple direct pin vs. matrix-integrated hardware combo.
#### Simple direct pin #### Simple direct pin

View file

@ -68,23 +68,23 @@ If the central keyboard part is either advertising for a pairing or waiting for
## Behaviors with Locality ## Behaviors with Locality
Most ZMK [behaviors](../behaviors/index.mdx) are processed exclusively on the central of the split keyboard as it handles the keymap state and any communication with the host devices. Most ZMK [behaviors](../keymaps/behaviors/index.mdx) are processed exclusively on the central of the split keyboard as it handles the keymap state and any communication with the host devices.
However, certain behaviors have "global" or "source" localities, where they can affect the peripherals when invoked. However, certain behaviors have "global" or "source" localities, where they can affect the peripherals when invoked.
### Global Locality Behaviors ### Global Locality Behaviors
These are behaviors that affect all keyboard parts, such as changing lighting effects: These are behaviors that affect all keyboard parts, such as changing lighting effects:
- [RGB underglow behaviors](../behaviors/underglow.md) - [RGB underglow behaviors](../keymaps/behaviors/underglow.md)
- [Backlight behaviors](../behaviors/backlight.md) - [Backlight behaviors](../keymaps/behaviors/backlight.md)
- [Power management behaviors](../behaviors/power.md) - [Power management behaviors](../keymaps/behaviors/power.md)
- [Soft off behavior](../behaviors/soft-off.md) - [Soft off behavior](../keymaps/behaviors/soft-off.md)
### Source Locality Behaviors ### Source Locality Behaviors
These behaviors only affect the keyboard part that they are invoked from: These behaviors only affect the keyboard part that they are invoked from:
- [Reset behaviors](../behaviors/reset.md) - [Reset behaviors](../keymaps/behaviors/reset.md)
:::warning[Nesting behaviors with locality] :::warning[Nesting behaviors with locality]
Currently there is [an issue](https://github.com/zmkfirmware/zmk/issues/1494) preventing both global and source locality behaviors from working as expected if they are invoked from another behavior, such as a hold-tap, tap dance or a mod-morph. Currently there is [an issue](https://github.com/zmkfirmware/zmk/issues/1494) preventing both global and source locality behaviors from working as expected if they are invoked from another behavior, such as a hold-tap, tap dance or a mod-morph.
@ -97,5 +97,5 @@ This is because the key bindings are processed on the central side which would t
::: :::
:::note[Combos] :::note[Combos]
[Combos](combos.md) always invoke behaviors with source locality on the central. [Combos](../keymaps/combos.md) always invoke behaviors with source locality on the central.
::: :::

View file

@ -15,28 +15,28 @@ ZMK is currently missing some features found in other popular firmware. This tab
| :------ | :----------- | :------------------- | :--------- | | :------ | :----------- | :------------------- | :--------- |
| **Feature** | ZMK | BlueMicro | QMK | | **Feature** | ZMK | BlueMicro | QMK |
| ---------------------------------------------------------------------------------------------------------------------------------- | :-: | :-------: | :-: | | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | :-: | :-------: | :-: |
| Low Latency BLE Support | ✅ | ✅ | | | Low Latency BLE Support | ✅ | ✅ | |
| Multi-Device BLE Support | ✅ | | | | Multi-Device BLE Support | ✅ | | |
| [USB Connectivity](behaviors/outputs.md) | ✅ | ✅ | ✅ | | [USB Connectivity](keymaps/behaviors/outputs.md) | ✅ | ✅ | ✅ |
| User Configuration Repositories | ✅ | | | | User Configuration Repositories | ✅ | | |
| Split Keyboard Support | ✅ | ✅ | ✅ | | Split Keyboard Support | ✅ | ✅ | ✅ |
| [Keymaps and Layers](behaviors/layers.md) | ✅ | ✅ | ✅ | | [Keymaps and Layers](keymaps/behaviors/layers.md) | ✅ | ✅ | ✅ |
| [Hold-Tap](behaviors/hold-tap.mdx) (which includes [Mod-Tap](behaviors/mod-tap.md) and [Layer-Tap](behaviors/layers.md#layer-tap)) | ✅ | ✅ | ✅ | | [Hold-Tap](keymaps/behaviors/hold-tap.mdx) (which includes [Mod-Tap](keymaps/behaviors/mod-tap.md) and [Layer-Tap](keymaps/behaviors/layers.md#layer-tap)) | ✅ | ✅ | ✅ |
| [Tap-Dance](behaviors/tap-dance.mdx) | ✅ | ✅[^2] | ✅ | | [Tap-Dance](keymaps/behaviors/tap-dance.mdx) | ✅ | ✅[^2] | ✅ |
| [Keyboard Codes](codes/index.mdx#keyboard) | ✅ | ✅ | ✅ | | [Keyboard Codes](keymaps/list-of-codes.mdx#keyboard) | ✅ | ✅ | ✅ |
| [Media](codes/index.mdx#media-controls) & [Consumer](codes/index.mdx#consumer-controls) Codes | ✅ | ✅ | ✅ | | [Media](keymaps/list-of-codes.mdx#media-controls) & [Consumer](keymaps/list-of-codes.mdx#consumer-controls) Codes | ✅ | ✅ | ✅ |
| [Encoders](features/encoders.md) | ✅ | ✅ | ✅ | | [Encoders](keymaps/encoders.md) | ✅ | ✅ | ✅ |
| [Display Support](features/displays.md)[^1] | 🚧 | 🚧 | ✅ | | [Display Support](features/displays.md)[^1] | 🚧 | 🚧 | ✅ |
| [RGB Underglow](features/underglow.md) | ✅ | ✅ | ✅ | | [RGB Underglow](features/underglow.md) | ✅ | ✅ | ✅ |
| [Backlight](features/backlight.mdx) | ✅ | ✅ | ✅ | | [Backlight](features/backlight.mdx) | ✅ | ✅ | ✅ |
| One Shot Keys | ✅ | ✅ | ✅ | | One Shot Keys | ✅ | ✅ | ✅ |
| [Combo Keys](features/combos.md) | ✅ | | ✅ | | [Combo Keys](keymaps/combos.md) | ✅ | | ✅ |
| [Macros](behaviors/macros.md) | ✅ | ✅ | ✅ | | [Macros](keymaps/behaviors/macros.md) | ✅ | ✅ | ✅ |
| Mouse Keys | 🚧 | ✅ | ✅ | | Mouse Keys | 🚧 | ✅ | ✅ |
| Low Active Power Usage | ✅ | | | | Low Active Power Usage | ✅ | | |
| Low Power Sleep States | ✅ | ✅ | | | Low Power Sleep States | ✅ | ✅ | |
| [Low Power Mode (VCC Shutoff)](behaviors/power.md) | ✅ | ✅ | | | [Low Power Mode (VCC Shutoff)](keymaps/behaviors/power.md) | ✅ | ✅ | |
| Battery Reporting | ✅ | ✅ | | | Battery Reporting | ✅ | ✅ | |
| Shell over BLE | 💡 | | | | Shell over BLE | 💡 | | |
| Realtime Keymap Updating | 💡 | | ✅ | | Realtime Keymap Updating | 💡 | | ✅ |

View file

@ -5,7 +5,7 @@ sidebar_label: Backlight
## Summary ## Summary
This page contains [backlight](../features/backlight.mdx) behaviors supported by ZMK. This page contains [backlight](../../features/backlight.mdx) behaviors supported by ZMK.
## Backlight Action Defines ## Backlight Action Defines
@ -38,8 +38,8 @@ Here is a table describing the action for each define:
:::note[Backlight settings persistence] :::note[Backlight settings persistence]
The backlight settings that are changed via the `&bl` behavior will be saved to flash storage and hence persist across restarts and firmware flashes. The backlight settings that are changed via the `&bl` behavior will be saved to flash storage and hence persist across restarts and firmware flashes.
They will also override the start values set by [`CONFIG_ZMK_BACKLIGHT_*_START` settings](../config/backlight.md#kconfig). They will also override the start values set by [`CONFIG_ZMK_BACKLIGHT_*_START` settings](../../config/backlight.md#kconfig).
However the settings will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory. However the settings will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory.
::: :::
### Examples ### Examples
@ -58,4 +58,4 @@ However the settings will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNC
## Split Keyboards ## Split Keyboards
Backlight behaviors are [global](../features/split-keyboards.md#global-locality-behaviors): This means that when triggered, they affect both the central and peripheral side of split keyboards. Backlight behaviors are [global](../../features/split-keyboards.md#global-locality-behaviors): This means that when triggered, they affect both the central and peripheral side of split keyboards.

View file

@ -49,7 +49,7 @@ Here is a table describing the command for each define:
:::note[Selected profile persistence] :::note[Selected profile persistence]
The profile that is selected by the `BT_SEL`/`BT_PRV`/`BT_NXT` actions will be saved to flash storage and hence persist across restarts and firmware flashes. The profile that is selected by the `BT_SEL`/`BT_PRV`/`BT_NXT` actions will be saved to flash storage and hence persist across restarts and firmware flashes.
However it will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory. However it will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory.
::: :::
## Bluetooth Behavior ## Bluetooth Behavior
@ -103,5 +103,5 @@ Please note there are five available Bluetooth profiles by default. If you need
::: :::
:::note :::note
If you clear bond of a paired profile, make sure you do the same thing on the peer device as well (typically achieved by _removing_ or _forgetting_ the bluetooth connection). Otherwise the peer will try to connect to your keyboard whenever it discovers it. But while the MAC address of both devices could remain the same, the security key no longer match: the peer device still possess the old key negotiated in the previous pairing procedure, but our keyboard firmware has deleted that key. So the connection will fail. If you [enabled USB logging](../development/usb-logging.mdx), you might see a lot of failed connection attempts due to the reason of “Security failed”. If you clear bond of a paired profile, make sure you do the same thing on the peer device as well (typically achieved by _removing_ or _forgetting_ the bluetooth connection). Otherwise the peer will try to connect to your keyboard whenever it discovers it. But while the MAC address of both devices could remain the same, the security key no longer match: the peer device still possess the old key negotiated in the previous pairing procedure, but our keyboard firmware has deleted that key. So the connection will fail. If you [enabled USB logging](../../development/usb-logging.mdx), you might see a lot of failed connection attempts due to the reason of “Security failed”.
::: :::

View file

@ -5,7 +5,7 @@ sidebar_label: Caps Word
## Summary ## Summary
The caps word behavior behaves similar to a caps lock, but will automatically deactivate when any key not in a continue list is pressed, or if the caps word key is pressed again. For smaller keyboards using [mod-taps](/docs/behaviors/mod-tap), this can help avoid repeated alternating holds when typing words in all caps. The caps word behavior behaves similar to a caps lock, but will automatically deactivate when any key not in a continue list is pressed, or if the caps word key is pressed again. For smaller keyboards using [mod-taps](mod-tap), this can help avoid repeated alternating holds when typing words in all caps.
The modifiers are applied only to the alphabetic (`A` to `Z`) keycodes, to avoid automatically applying them to numeric values, etc. The modifiers are applied only to the alphabetic (`A` to `Z`) keycodes, to avoid automatically applying them to numeric values, etc.

View file

@ -16,11 +16,11 @@ Simply put, the hold-tap key will output the 'hold' behavior if it's held for a
The graph below shows how the hold-tap decides between a 'tap' and a 'hold'. The graph below shows how the hold-tap decides between a 'tap' and a 'hold'.
![Simple behavior](../assets/hold-tap/case1_2.svg) ![Simple behavior](../../assets/hold-tap/case1_2.svg)
By default, the hold-tap is configured to also select the 'hold' functionality if another key is tapped while it's active: By default, the hold-tap is configured to also select the 'hold' functionality if another key is tapped while it's active:
![Hold preferred behavior](../assets/hold-tap/case_hold_preferred.svg) ![Hold preferred behavior](../../assets/hold-tap/case_hold_preferred.svg)
We call this the 'hold-preferred' flavor of hold-taps. While this flavor may work very well for a ctrl/escape key, it's not very well suited for home-row mods or layer-taps. That's why there are two more flavors to choose from: 'tap-preferred' and 'balanced'. We call this the 'hold-preferred' flavor of hold-taps. While this flavor may work very well for a ctrl/escape key, it's not very well suited for home-row mods or layer-taps. That's why there are two more flavors to choose from: 'tap-preferred' and 'balanced'.
@ -33,7 +33,7 @@ We call this the 'hold-preferred' flavor of hold-taps. While this flavor may wor
When the hold-tap key is released and the hold behavior has not been triggered, the tap behavior will trigger. When the hold-tap key is released and the hold behavior has not been triggered, the tap behavior will trigger.
![Hold-tap comparison](../assets/hold-tap/comparison.svg) ![Hold-tap comparison](../../assets/hold-tap/comparison.svg)
### Basic Usage ### Basic Usage
@ -144,7 +144,7 @@ the hold-tap. For homerow mods, this is not always ideal, because it prevents co
#### Using different behavior types with hold-taps #### Using different behavior types with hold-taps
You can create instances of hold-taps invoking most [behavior types](../features/keymaps.mdx#behaviors) for hold or tap actions, by referencing their node labels in the `bindings` value. You can create instances of hold-taps invoking most [behavior types](../index.mdx#behaviors) for hold or tap actions, by referencing their node labels in the `bindings` value.
The two parameters that are passed to the hold-tap in your keymap will be forwarded to the referred behaviors, first one to the hold behavior and second one to the tap. The two parameters that are passed to the hold-tap in your keymap will be forwarded to the referred behaviors, first one to the hold behavior and second one to the tap.
If you use behaviors that accept no parameters such as [mod-morphs](mod-morph.md) or [macros](macros.md), you can pass a dummy parameter value such as `0` to the hold-tap when you use it in your keymap. If you use behaviors that accept no parameters such as [mod-morphs](mod-morph.md) or [macros](macros.md), you can pass a dummy parameter value such as `0` to the hold-tap when you use it in your keymap.
@ -155,7 +155,7 @@ For instance, a hold-tap with node label `caps` and `bindings = <&kp>, <&caps_wo
``` ```
:::info :::info
You cannot use behaviors that expect more than one parameter such as [`&bt`](bluetooth.md) and [`&rgb_ug`](underglow.md) with hold-taps, due to the limitations of the [devicetree keymap format](../config/index.md#devicetree-files). You cannot use behaviors that expect more than one parameter such as [`&bt`](bluetooth.md) and [`&rgb_ug`](underglow.md) with hold-taps, due to the limitations of the [devicetree keymap format](../../config/index.md#devicetree-files).
One workaround is to create a [macro](macros.md) that invokes those behaviors and use the macro as the hold or tap action. One workaround is to create a [macro](macros.md) that invokes those behaviors and use the macro as the hold or tap action.
::: :::

View file

@ -10,14 +10,14 @@ a certain key.
The categories of supported codes are: The categories of supported codes are:
- [Keyboard & Keypad](../codes/keyboard-keypad.mdx) - [Keyboard](../list-of-codes.mdx#keyboard)
- [Editing](../codes/editing.mdx) - [Modifiers](../list-of-codes.mdx#modifiers)
- [Media](../codes/media.mdx) - [Keypad](../list-of-codes.mdx#keypad)
- [Applications](../codes/applications.mdx) - [Editing](../list-of-codes.mdx#editing)
- [Input Assist](../codes/input-assist.mdx) - [Media](../list-of-codes.mdx#media)
- [Power](../codes/power.mdx) - [Applications](../list-of-codes.mdx#applications)
- [Input Assist](../list-of-codes.mdx#input-assist)
Please visit the [codes](../codes/index.mdx) section for a comprehensive list. - [Power & Lock](../list-of-codes.mdx#power--lock)
For advanced users, user-defined HID usages are also supported but must be encoded, please see [`dt-bindings/zmk/keys.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/keys.h) for further insight. For advanced users, user-defined HID usages are also supported but must be encoded, please see [`dt-bindings/zmk/keys.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/keys.h) for further insight.

View file

@ -14,7 +14,7 @@ Example uses for key toggle include shift lock, or `ALT-TAB` window switching wi
### Behavior Binding ### Behavior Binding
- Reference: `&kt` - Reference: `&kt`
- Parameter: The [keycode](../codes/index.mdx), e.g. `LALT` or `DOWN_ARROW` - Parameter: The [keycode](../list-of-codes.mdx), e.g. `LALT` or `DOWN_ARROW`
Example: Example:
@ -22,5 +22,5 @@ Example:
&kt LALT &kt LALT
``` ```
You can use any keycode that works for `&kp` as parameter to `&kt`, however, [modified keys](../codes/modifiers.mdx#modifier-functions) such as `LA(A)` will be toggled based on the status of the base keycode (in this case `A`). You can use any keycode that works for `&kp` as parameter to `&kt`, however, [modified keys](../modifiers.mdx#modifier-functions) such as `LA(A)` will be toggled based on the status of the base keycode (in this case `A`).
In other words, modifiers are ignored when determining whether or not the key is currently pressed. In other words, modifiers are ignored when determining whether or not the key is currently pressed.

View file

@ -9,7 +9,7 @@ Often, you may want a certain key position to alter which layers are enabled, ch
Some of those behaviors are still in the works; the ones that are working now are documented here. Some of those behaviors are still in the works; the ones that are working now are documented here.
:::note :::note
Multiple layers can be active at the same time and activating a layer will not deactivate layers higher up in the "layer stack". See [Layers](../features/keymaps.mdx#layers) for more information. Multiple layers can be active at the same time and activating a layer will not deactivate layers higher up in the "layer stack". See [Layers](../index.mdx#layers) for more information.
::: :::
## Defines to Refer to Layers ## Defines to Refer to Layers
@ -80,7 +80,7 @@ You can configure a different tapping term or tweak other properties noted in th
:::info :::info
Functionally, the layer-tap is a [hold-tap](hold-tap.mdx) of the ["tap-preferred" flavor](hold-tap.mdx#flavors) and a [`tapping-term-ms`](hold-tap.mdx#tapping-term-ms) of 200 that takes in a [`momentary layer`](#momentary-layer) and a [keypress](key-press.md) as its "hold" and "tap" parameters, respectively. Functionally, the layer-tap is a [hold-tap](hold-tap.mdx) of the ["tap-preferred" flavor](hold-tap.mdx#flavors) and a [`tapping-term-ms`](hold-tap.mdx#tapping-term-ms) of 200 that takes in a [`momentary layer`](#momentary-layer) and a [keypress](key-press.md) as its "hold" and "tap" parameters, respectively.
For users who want to send a different [keycode](../codes/index.mdx) depending on if the same key is held or tapped, see [Mod-Tap](mod-tap.md). For users who want to send a different [keycode](../list-of-codes.mdx) depending on if the same key is held or tapped, see [Mod-Tap](mod-tap.md).
Similarly, for users looking to create a keybind like the layer-tap that depending on how long the key is held, invokes behaviors like [sticky keys](sticky-key.md) or [key toggles](key-toggle.md), see [Hold-Tap](hold-tap.mdx). Similarly, for users looking to create a keybind like the layer-tap that depending on how long the key is held, invokes behaviors like [sticky keys](sticky-key.md) or [key toggles](key-toggle.md), see [Hold-Tap](hold-tap.mdx).
@ -119,4 +119,4 @@ Example:
## Conditional Layers ## Conditional Layers
The "conditional layers" feature enables a particular layer when all layers in a specified set are active. The "conditional layers" feature enables a particular layer when all layers in a specified set are active.
For more information, see [conditional layers](../features/conditional-layers.md). For more information, see [conditional layers](../conditional-layers.md).

View file

@ -45,12 +45,12 @@ The macro can then be bound in your keymap by referencing it by the label `&zed_
:::note :::note
For use cases involving sending a single keycode with modifiers, for instance ctrl+tab, the [key press behavior](key-press.md) For use cases involving sending a single keycode with modifiers, for instance ctrl+tab, the [key press behavior](key-press.md)
with [modifier functions](../codes/modifiers.mdx#modifier-functions) can be used instead of a macro. with [modifier functions](../modifiers.mdx#modifier-functions) can be used instead of a macro.
::: :::
### Bindings ### Bindings
Like [hold-taps](/docs/behaviors/hold-tap), macros are created by composing other behaviors, and any of those behaviors can Like [hold-taps](hold-tap), macros are created by composing other behaviors, and any of those behaviors can
be added to the `bindings` list, e.g.: be added to the `bindings` list, e.g.:
```dts ```dts
@ -111,7 +111,7 @@ bindings
### Wait Time ### Wait Time
The wait time setting controls how long of a delay is introduced between behaviors in the `bindings` list. The initial wait time for a macro, The wait time setting controls how long of a delay is introduced between behaviors in the `bindings` list. The initial wait time for a macro,
which is equal to the value of [`CONFIG_ZMK_MACRO_DEFAULT_WAIT_MS`](../config/behaviors.md#macro) by default, can which is equal to the value of [`CONFIG_ZMK_MACRO_DEFAULT_WAIT_MS`](../../config/behaviors.md#macro) by default, can
be set by assigning a value to the `wait-ms` property of the macro, e.g. `wait-ms = <20>;`. If you want to update the wait time at any be set by assigning a value to the `wait-ms` property of the macro, e.g. `wait-ms = <20>;`. If you want to update the wait time at any
point in the macro bindings list, use `&macro_wait_time`, e.g. `&macro_wait_time 30`. A full example: point in the macro bindings list, use `&macro_wait_time`, e.g. `&macro_wait_time 30`. A full example:
@ -127,7 +127,7 @@ bindings
### Tap Time ### Tap Time
The tap time setting controls how long a tapped behavior is held in the `bindings` list. The initial tap time for a macro, The tap time setting controls how long a tapped behavior is held in the `bindings` list. The initial tap time for a macro,
which is equal to the value of [`CONFIG_ZMK_MACRO_DEFAULT_TAP_MS`](../config/behaviors.md#macro) by default, can which is equal to the value of [`CONFIG_ZMK_MACRO_DEFAULT_TAP_MS`](../../config/behaviors.md#macro) by default, can
be set by assigning a value to the `tap-ms` property of the macro, e.g. `tap-ms = <20>;`. If you want to update the tap time at any be set by assigning a value to the `tap-ms` property of the macro, e.g. `tap-ms = <20>;`. If you want to update the tap time at any
point in a macro bindings list, use `&macro_tap_time`, e.g. `&macro_tap_time 30`. A full example: point in a macro bindings list, use `&macro_tap_time`, e.g. `&macro_tap_time 30`. A full example:
@ -144,9 +144,9 @@ bindings
Macros use an internal queue to invoke each behavior in the bindings list when triggered, which has a size of 64 by default. Bindings in "press" and "release" modes correspond to one event in the queue, whereas "tap" mode bindings correspond to two (one for press and one for release). As a result, the effective number of actions processed might be less than 64 and this can cause problems for long macros. Macros use an internal queue to invoke each behavior in the bindings list when triggered, which has a size of 64 by default. Bindings in "press" and "release" modes correspond to one event in the queue, whereas "tap" mode bindings correspond to two (one for press and one for release). As a result, the effective number of actions processed might be less than 64 and this can cause problems for long macros.
To prevent issues with longer macros, you can change the size of this queue via the `CONFIG_ZMK_BEHAVIORS_QUEUE_SIZE` setting in your configuration, [typically through your `.conf` file](../config/index.md). For example, `CONFIG_ZMK_BEHAVIORS_QUEUE_SIZE=512` would allow your macro to type about 256 characters. To prevent issues with longer macros, you can change the size of this queue via the `CONFIG_ZMK_BEHAVIORS_QUEUE_SIZE` setting in your configuration, [typically through your `.conf` file](../../config/index.md). For example, `CONFIG_ZMK_BEHAVIORS_QUEUE_SIZE=512` would allow your macro to type about 256 characters.
Another limit worth noting is that the maximum number of bindings you can pass to a `bindings` field in the [Devicetree](../config/index.md#devicetree-files) is 256, which also constrains how many behaviors can be invoked by a macro. Another limit worth noting is that the maximum number of bindings you can pass to a `bindings` field in the [Devicetree](../../config/index.md#devicetree-files) is 256, which also constrains how many behaviors can be invoked by a macro.
## Parameterized Macros ## Parameterized Macros
@ -218,7 +218,7 @@ Below are some examples of how the macro behavior can be used for various useful
### Layer Activation + More ### Layer Activation + More
Macros make it easy to combine a [layer behavior](/docs/behaviors/layers), e.g. `&mo` with another behavior at the same time. Macros make it easy to combine a [layer behavior](layers), e.g. `&mo` with another behavior at the same time.
Common examples are enabling one or more modifiers when the layer is active, or changing the RBG underglow color. Common examples are enabling one or more modifiers when the layer is active, or changing the RBG underglow color.
To achieve this, a combination of a 0ms wait time and splitting the press and release between a `&macro_pause_for_release` is used: To achieve this, a combination of a 0ms wait time and splitting the press and release between a `&macro_pause_for_release` is used:

View file

@ -45,9 +45,9 @@ You can configure a different tapping term in your keymap:
``` ```
:::info :::info
Under the hood, the mod-tap is simply a [hold-tap](hold-tap.mdx) of the ["hold-preferred" flavor](hold-tap.mdx#flavors) with a [`tapping-term-ms`](hold-tap.mdx#tapping-term-ms) of 200 that takes in two [keypresses](key-press.md) as its "hold" and "tap" parameters. This means that the mod-tap can be used to invoke **any** [keycode](../codes/index.mdx), and is not limited to only activating [modifier keys](../codes/modifiers.mdx) when it is held. Under the hood, the mod-tap is simply a [hold-tap](hold-tap.mdx) of the ["hold-preferred" flavor](hold-tap.mdx#flavors) with a [`tapping-term-ms`](hold-tap.mdx#tapping-term-ms) of 200 that takes in two [keypresses](key-press.md) as its "hold" and "tap" parameters. This means that the mod-tap can be used to invoke **any** [keycode](../list-of-codes.mdx), and is not limited to only activating [modifier keys](../modifiers.mdx) when it is held.
For users who want to momentarily access a specific [layer](../features/keymaps.mdx#layers) while a key is held and send a keycode when the same key is tapped, see [Layer-Tap](layers.md#layer-tap). For users who want to momentarily access a specific [layer](../index.mdx#layers) while a key is held and send a keycode when the same key is tapped, see [Layer-Tap](layers.md#layer-tap).
Similarly, for users looking to create a keybind like the mod-tap that invokes behaviors _other_ than [keypresses](key-press.md), like [sticky keys](sticky-key.md) or [key toggles](key-toggle.md), see [Hold-Tap](hold-tap.mdx). Similarly, for users looking to create a keybind like the mod-tap that invokes behaviors _other_ than [keypresses](key-press.md), like [sticky keys](sticky-key.md) or [key toggles](key-toggle.md), see [Hold-Tap](hold-tap.mdx).

View file

@ -10,7 +10,7 @@ and scroll action support is planned for the future.
:::warning[Refreshing the HID descriptor] :::warning[Refreshing the HID descriptor]
Enabling or disabling the mouse emulation feature modifies the HID report descriptor and requires it to be [refreshed](../features/bluetooth.md#refreshing-the-hid-descriptor). Enabling or disabling the mouse emulation feature modifies the HID report descriptor and requires it to be [refreshed](../../features/bluetooth.md#refreshing-the-hid-descriptor).
The mouse functionality will not work over BLE until that is done. The mouse functionality will not work over BLE until that is done.
::: :::

View file

@ -46,7 +46,7 @@ The output selection behavior changes the preferred output on press.
:::note[Output selection persistence] :::note[Output selection persistence]
The endpoint that is selected by the `&out` behavior will be saved to flash storage and hence persist across restarts and firmware flashes. The endpoint that is selected by the `&out` behavior will be saved to flash storage and hence persist across restarts and firmware flashes.
However it will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory. However it will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory.
::: :::
### Examples ### Examples

View file

@ -45,7 +45,7 @@ Here is a table describing the command for each define:
:::note[External power state persistence] :::note[External power state persistence]
The on/off state that is set by the `&ext_power` behavior will be saved to flash storage and hence persist across restarts and firmware flashes. The on/off state that is set by the `&ext_power` behavior will be saved to flash storage and hence persist across restarts and firmware flashes.
However it will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory. However it will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory.
::: :::
### Example: ### Example:
@ -70,4 +70,4 @@ However it will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../con
## Split Keyboards ## Split Keyboards
Power management behaviors are [global](../features/split-keyboards.md#global-locality-behaviors): This means that when triggered, they affects both the central and peripheral side of split keyboards. Power management behaviors are [global](../../features/split-keyboards.md#global-locality-behaviors): This means that when triggered, they affects both the central and peripheral side of split keyboards.

View file

@ -44,4 +44,4 @@ Example:
## Split Keyboards ## Split Keyboards
Both basic and bootloader reset behaviors are [source-specific](../features/split-keyboards.md#source-locality-behaviors): This means that it affects the side of the keyboard that contains the behavior binding for split keyboards. For example if you press a key with the `&sys_reset` binding on the left half of the keyboard, the left half will be reset. If you want to be able to reset both sides you can put the bindings on both sides of the keyboard and activate it on the side you would like to reset. Both basic and bootloader reset behaviors are [source-specific](../../features/split-keyboards.md#source-locality-behaviors): This means that it affects the side of the keyboard that contains the behavior binding for split keyboards. For example if you press a key with the `&sys_reset` binding on the left half of the keyboard, the left half will be reset. If you want to be able to reset both sides you can put the bindings on both sides of the keyboard and activate it on the side you would like to reset.

View file

@ -17,7 +17,7 @@ The standard sensor rotation behavior allows fully binding behaviors to be invok
### Configuration ### Configuration
Here is an example that binds the [RGB Underglow Behavior](/docs/behaviors/underglow.md) to change the RGB brightness: Here is an example that binds the [RGB Underglow Behavior](underglow.md) to change the RGB brightness:
```dts ```dts
/ { / {
@ -52,7 +52,7 @@ allowing the sensor rotation instance to be bound with two parameters at usage t
Here is an example, showing how send key presses on rotation: Here is an example, showing how send key presses on rotation:
First, defining the sensor rotation itself, binding the [Key Press Behavior](/docs/behaviors/key-press.md) twice, then binding it in the `sensor-bindings` property of a keymap layer: First, defining the sensor rotation itself, binding the [Key Press Behavior](key-press.md) twice, then binding it in the `sensor-bindings` property of a keymap layer:
```dts ```dts
/ { / {

View file

@ -7,9 +7,9 @@ sidebar_label: Soft Off
The soft off behavior is used to force the keyboard into an off state. Depending on the specific keyboard hardware, the keyboard can be turned back on again either with a dedicated on/off button that is available, or using the reset button found on the device. The soft off behavior is used to force the keyboard into an off state. Depending on the specific keyboard hardware, the keyboard can be turned back on again either with a dedicated on/off button that is available, or using the reset button found on the device.
Refer to the [soft off config](../config/power.md#soft-off) for details on enabling soft off in order to use this behavior. Refer to the [soft off config](../../config/power.md#soft-off) for details on enabling soft off in order to use this behavior.
For more information, see the [Soft Off Feature](../features/soft-off.md) page. For more information, see the [Soft Off Feature](../../features/soft-off.md) page.
### Behavior Binding ### Behavior Binding

View file

@ -20,7 +20,7 @@ Defines the maximum elapsed time after the last tap-dance keybind press before a
#### `bindings` #### `bindings`
An array of one or more keybinds. This list can include [any ZMK keycode](../codes/) and any listed ZMK behavior, like [hold-taps](hold-tap.mdx), or [sticky keys](sticky-key.md). The index of a keybind in the `bindings` array corresponds to the number of times the tap-dance binding is pressed. For example, in the [basic tap-dance counter](#basic-example-counter) shown below, `&kp N2` is the second binding in the array of `bindings`: we then see an output of `2` when the `td0` binding is pressed twice. An array of one or more keybinds. This list can include [any ZMK keycode](../list-of-codes.mdx) and any listed ZMK behavior, like [hold-taps](hold-tap.mdx), or [sticky keys](sticky-key.md). The index of a keybind in the `bindings` array corresponds to the number of times the tap-dance binding is pressed. For example, in the [basic tap-dance counter](#basic-example-counter) shown below, `&kp N2` is the second binding in the array of `bindings`: we then see an output of `2` when the `td0` binding is pressed twice.
The number of bindings in this array also determines the tap-dance's maximum number of keypresses. When a tap-dance reaches its maximum number of keypresses, it will immediately invoke the last behavior in its list of `bindings`, rather than waiting for [`tapping-term-ms`](#tapping-term-ms) to expire before the output is displayed. The number of bindings in this array also determines the tap-dance's maximum number of keypresses. When a tap-dance reaches its maximum number of keypresses, it will immediately invoke the last behavior in its list of `bindings`, rather than waiting for [`tapping-term-ms`](#tapping-term-ms) to expire before the output is displayed.
@ -65,7 +65,7 @@ This example configures a tap-dance named `td0` that outputs the number of times
The following image describes the behavior of this particular tap-dance. The following image describes the behavior of this particular tap-dance.
![Timing Diagram](../assets/tap-dance/timing_diagram.svg) ![Timing Diagram](../../assets/tap-dance/timing_diagram.svg)
:::note :::note
Alphanumeric [`key press`](key-press.md) bindings, like those used for `td0`, will release as soon as an interrupting key press occurs. For instance, if a modifier key like `LSHIFT` were to replace the `N1` binding in the last example above, it would remain pressed until `td0`'s binding is released and the output would instead be `J`. Any following alphanumeric key presses would be capitalized as long as `td0` is held down. Alphanumeric [`key press`](key-press.md) bindings, like those used for `td0`, will release as soon as an interrupting key press occurs. For instance, if a modifier key like `LSHIFT` were to replace the `N1` binding in the last example above, it would remain pressed until `td0`'s binding is released and the output would instead be `J`. Any following alphanumeric key presses would be capitalized as long as `td0` is held down.

View file

@ -5,7 +5,7 @@ sidebar_label: RGB Underglow
## Summary ## Summary
This page contains [RGB Underglow](../features/underglow.md) behaviors supported by ZMK. This page contains [RGB Underglow](../../features/underglow.md) behaviors supported by ZMK.
## RGB Action Defines ## RGB Action Defines
@ -57,8 +57,8 @@ Value Limits:
:::note[RGB settings persistence] :::note[RGB settings persistence]
The RGB settings that are changed via the `&rgb_ug` behavior will be saved to flash storage and hence persist across restarts and firmware flashes. The RGB settings that are changed via the `&rgb_ug` behavior will be saved to flash storage and hence persist across restarts and firmware flashes.
They will also override the start values set by [`CONFIG_ZMK_RGB_*_START` settings](../config/underglow.md#kconfig). They will also override the start values set by [`CONFIG_ZMK_RGB_*_START` settings](../../config/underglow.md#kconfig).
However the settings will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory. However the settings will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory.
::: :::
## Examples ## Examples
@ -77,4 +77,4 @@ However the settings will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNC
## Split Keyboards ## Split Keyboards
RGB underglow behaviors are [global](../features/split-keyboards.md#global-locality-behaviors): This means that when triggered, they affect both the central and peripheral side of split keyboards. RGB underglow behaviors are [global](../../features/split-keyboards.md#global-locality-behaviors): This means that when triggered, they affect both the central and peripheral side of split keyboards.

View file

@ -45,7 +45,7 @@ Key positions are numbered like the keys in your keymap, starting at 0. So, if t
- You are not limited to `&kp` bindings. You can use all ZMK behaviors there, like `&mo`, `&bt`, `&mt`, `&lt` etc. - You are not limited to `&kp` bindings. You can use all ZMK behaviors there, like `&mo`, `&bt`, `&mt`, `&lt` etc.
:::note[Source-specific behaviors on split keyboards] :::note[Source-specific behaviors on split keyboards]
Invoking a [source-specific behavior](split-keyboards.md#source-locality-behaviors) such as one of the [reset behaviors](behaviors/reset.md) using a combo will always trigger it on the central side of the keyboard, regardless of the side that the keys corresponding to `key-positions` are on. Invoking a [source-specific behavior](../features/split-keyboards.md#source-locality-behaviors) such as one of the [reset behaviors](behaviors/reset.md) using a combo will always trigger it on the central side of the keyboard, regardless of the side that the keys corresponding to `key-positions` are on.
::: :::
See [combo configuration](../config/combos.md) for advanced configuration options. See [combo configuration](../config/combos.md) for advanced configuration options.

View file

@ -50,7 +50,7 @@ condition in another configuration, possibly repeatedly.
:::warning :::warning
When configured as a `then-layer`, a layer's activation status is entirely controlled by the When configured as a `then-layer`, a layer's activation status is entirely controlled by the
conditional layers feature. Even if the layer is activated for another reason (such as a conditional layers feature. Even if the layer is activated for another reason (such as a
[momentary layer](../behaviors/layers.md#momentary-layer) behavior), it will be immediately [momentary layer](behaviors/layers.md#momentary-layer) behavior), it will be immediately
deactivated if the associated `then-layers` configuration is not met. As such, we recommend deactivated if the associated `then-layers` configuration is not met. As such, we recommend
avoiding using regular layer behaviors for `then-layer` targets. avoiding using regular layer behaviors for `then-layer` targets.
::: :::

View file

@ -19,13 +19,13 @@ Keyboards and macropads with encoder support will typically take the two EC11 pi
### Rotation ### Rotation
Rotation is handled separately as a type of sensor. The behavior for this is set in `sensor-bindings`. See [Sensor Rotation](../behaviors/sensor-rotate.md) for customizing this behavior. Rotation is handled separately as a type of sensor. The behavior for this is set in `sensor-bindings`. See [Sensor Rotation](behaviors/sensor-rotate.md) for customizing this behavior.
```dts ```dts
sensor-bindings = <BINDING [CW_KEY] [CCW_KEY]>; sensor-bindings = <BINDING [CW_KEY] [CCW_KEY]>;
``` ```
- `BINDING` is either a user-defined behavior, or `&inc_dec_kp` for key presses (see [Key Press](../behaviors/key-press.md) for details on available keycodes). - `BINDING` is either a user-defined behavior, or `&inc_dec_kp` for key presses (see [Key Press](behaviors/key-press.md) for details on available keycodes).
- `CW_KEY` is the keycode activated by a clockwise turn. - `CW_KEY` is the keycode activated by a clockwise turn.
- `CCW_KEY` is the keycode activated by a counter-clockwise turn. - `CCW_KEY` is the keycode activated by a counter-clockwise turn.

View file

@ -32,7 +32,7 @@ For example, the simplest behavior in ZMK is the "key press" behavior, which res
(a certain spot on the keyboard), and when that position is pressed, send a keycode to the host, and (a certain spot on the keyboard), and when that position is pressed, send a keycode to the host, and
when the key position is released, updates the host to notify of the keycode being released. when the key position is released, updates the host to notify of the keycode being released.
For the full set of possible behaviors, see the [overview page for behaviors](../behaviors/index.mdx). For the full set of possible behaviors, see the [overview page for behaviors](behaviors/index.mdx).
## Layers ## Layers
@ -44,7 +44,7 @@ in ZMK contains a set of bindings that bind a certain behavior to a certain key
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| _A simplified diagram showing three layers. The layout of each layer is the same (they all contain four keys), but the behavior bindings within each layer can be different._ | | _A simplified diagram showing three layers. The layout of each layer is the same (they all contain four keys), but the behavior bindings within each layer can be different._ |
All layers are assigned and referred to by a natural number, with the base layer being layer `0`. It is common to [use the C preprocessor to "name" layers](../behaviors/layers.md#defines-to-refer-to-layers), making them more legible. All layers are assigned and referred to by a natural number, with the base layer being layer `0`. It is common to [use the C preprocessor to "name" layers](behaviors/layers.md#defines-to-refer-to-layers), making them more legible.
The default layer (the base layer with index 0) is always enabled. Certain bound behaviors may enable/disable additional layers. The default layer (the base layer with index 0) is always enabled. Certain bound behaviors may enable/disable additional layers.
@ -53,7 +53,7 @@ When a key location is pressed/released, the _highest-valued currently active_ l
Note that the _activation_ order isn't relevant for determining the priority of active layers, it is determined _only_ by the definition order. Note that the _activation_ order isn't relevant for determining the priority of active layers, it is determined _only_ by the definition order.
:::tip :::tip
If you wish to use multiple base layers (with a [toggle](../behaviors/layers.md#toggle-layer)), e.g. one for QWERTY and another for Colemak layouts, you will want these layers to have the lowest value possible. In other words, one should be layer `0`, and the other should be layer `1`. This allows other momentary layers activated on top of them to work with both. If you wish to use multiple base layers (with a [toggle](behaviors/layers.md#toggle-layer)), e.g. one for QWERTY and another for Colemak layouts, you will want these layers to have the lowest value possible. In other words, one should be layer `0`, and the other should be layer `1`. This allows other momentary layers activated on top of them to work with both.
::: :::
## Behavior Bindings ## Behavior Bindings
@ -143,7 +143,7 @@ Each layer of your keymap will be nested under the keymap node. Here is an examp
Each layer should have: Each layer should have:
1. A `bindings` property this will be a list of [behavior bindings](../behaviors/index.mdx), one for each key position for the keyboard. 1. A `bindings` property this will be a list of [behavior bindings](behaviors/index.mdx), one for each key position for the keyboard.
1. (Optional) A `sensor-bindings` property that will be a list of behavior bindings for each sensor on the keyboard. (Currently, only encoders are supported as sensor hardware, but in the future devices like trackpoints would be supported the same way) 1. (Optional) A `sensor-bindings` property that will be a list of behavior bindings for each sensor on the keyboard. (Currently, only encoders are supported as sensor hardware, but in the future devices like trackpoints would be supported the same way)
### Multiple Layers ### Multiple Layers
@ -155,7 +155,7 @@ Here is an example of a trio of layers for a simple 6-key macropad:
<KeymapExample /> <KeymapExample />
:::note :::note
Even if layer `1` was to be activated after `2`, layer `2` would still have priority as it is higher valued. Behaviors such as [To Layer (`&to`)](../behaviors/layers.md#to-layer) can be used to enable one layer _and disable all other non-default layers_, though. Even if layer `1` was to be activated after `2`, layer `2` would still have priority as it is higher valued. Behaviors such as [To Layer (`&to`)](behaviors/layers.md#to-layer) can be used to enable one layer _and disable all other non-default layers_, though.
::: :::
### Complete Example ### Complete Example

View file

@ -0,0 +1,135 @@
---
title: List of Keycodes
sidebar_label: List of Codes
---
import OsLegend from "@site/src/components/codes/OsLegend";
import ToastyContainer from "@site/src/components/codes/ToastyContainer";
import Table from "@site/src/components/codes/Table";
:::warning
Take extra notice of the spelling of the keycodes, especially the shorthand spelling.
Otherwise, it will result in an elusive parsing error!
:::
:::info[Keyboard vs. Consumer keycodes]
In the below tables, there are keycode pairs with similar names where one variant has a `K_` prefix and another `C_`.
These variants correspond to similarly named usages from different [HID usage pages](https://usb.org/sites/default/files/hut1_2.pdf#page=16),
namely the "keyboard/keypad" and "consumer" ones respectively.
In practice, some OS and applications might listen to only one of the variants.
You can use the values in the compatibility columns below to assist you in selecting which one to use.
:::
This is the reference page for keycodes used by behaviors. Use the table of contents (on the right or the top) for easy navigation.
<OsLegend />
<ToastyContainer />
## Keyboard
### Letters
<Table group="keyboard-letters" />
### Numbers
<Table group="keyboard-numbers" />
### Symbols / Punctuation
<Table group="keyboard-symbols" />
### Control & Whitespace
<Table group="keyboard-control-whitespace" />
### Navigation
<Table group="keyboard-navigation" />
### Locks
<Table group="keyboard-locks" />
### F Keys
<Table group="keyboard-fkeys" />
### International
<Table group="keyboard-international" />
### Language
<Table group="keyboard-language" />
### Miscellaneous
<Table group="keyboard-miscellaneous" />
## Modifiers
The [Modifiers](modifiers.mdx) page includes further information.
<Table group="keyboard-modifiers" />
## Keypad
<Table group="keypad" />
### Numbers
<Table group="keypad-numbers" />
### Symbols / Operations
<Table group="keypad-operations" />
## Editing
### Cut, Copy, Paste
<Table group="cut-copy-paste" />
### Undo, Redo
<Table group="undo-redo" />
## Media
### Sound / Volume
<Table group="sound" />
### Display
<Table group="display" />
### Media Controls
<Table group="media-controls" />
### Consumer Menus
<Table group="consumer-menus" />
### Consumer Controls
<Table group="consumer-controls" />
## Applications
### Application Controls
<Table group="application-controls" />
### Applications (Launch)
<Table group="applications" />
## Input Assist
<Table group="input-assist" />
## Power & Lock
<Table group="power" />

View file

@ -1,26 +1,10 @@
--- ---
title: Modifiers title: Modifiers
sidebar_label: Modifiers sidebar_label: Modifiers
hide_title: true
--- ---
import OsLegend from "@site/src/components/codes/OsLegend"; Modifiers are the special keyboard keys: _shift_, _alt_, _control_ & _GUI_. Their keycodes can be found in the [list of codes](./list-of-codes.mdx#modifiers).
import ToastyContainer from "@site/src/components/codes/ToastyContainer"; Modifiers can be used both as [keys](#modifier-keys) and as [functions](#modifier-functions).
import Table from "@site/src/components/codes/Table";
<OsLegend />
<ToastyContainer />
## Modifiers
Modifiers are the special keyboard keys: _shift_, _alt_, _control_ & _GUI_.
Modifiers can be used in two forms within ZMK:
- Modifier [Keys](#modifier-keys) → `LEFT_SHIFT`
- Modifier [Functions](#modifier-functions) → `LS(code)`
<Table group="keyboard-modifiers" />
### Modifier Keys ### Modifier Keys
@ -42,7 +26,7 @@ These functions take the form: `XX(code)`
- `&kp LS(LALT)` = `LEFT_SHIFT` + `LEFT_ALT` - `&kp LS(LALT)` = `LEFT_SHIFT` + `LEFT_ALT`
- Some basic codes already include a modifier function in their definition: - Some basic codes already include a modifier function in their definition:
- `DOLLAR` = `LS(NUMBER_4)` - `DOLLAR` = `LS(NUMBER_4)`
- There are left- and right-handed versions of each modifier (also see table above): - There are left- and right-handed versions of each modifier (also see [table in the list of codes](./list-of-codes.mdx#modifiers)):
- `LS(x)`, `LC(x)`, `LA(x)`, `LG(x)`, `RS(x)`, `RC(x)`, `RA(x)`, `RG(x)` - `LS(x)`, `LC(x)`, `LA(x)`, `LG(x)`, `RS(x)`, `RC(x)`, `RA(x)`, `RG(x)`
- Modified keys can safely be rolled-over. Modifier functions are released when another key is pressed. - Modified keys can safely be rolled-over. Modifier functions are released when another key is pressed.
- Press `&kp LS(A)`, then press `&kp B`, release `&kp LS(A)` and release `&kp B` results in **Ab**. Only the A is capitalized. - Press `&kp LS(A)`, then press `&kp B`, release `&kp LS(A)` and release `&kp B` results in **Ab**. Only the A is capitalized.

View file

@ -19,7 +19,7 @@ If you are reviewing these errors in the GitHub Actions tab, they can be found i
### Keymap Error ### Keymap Error
If you get an error stating `Keymap node not found, check a keymap is available and is has compatible = "zmk,keymap" set` this is an indication that the build process cannot find the keymap. Double check that the `<keyboard>.keymap` file is present and has been discovered by the build process. This can be checked by looking for a line in the build log stating `-- Using keymap file: /path/to/keymap/file/<keyboard>.keymap`. Inside the keymap file ensure the keymap node has `compatible = zmk,keymap` and it's not misspelled. For more information see the [Keymap](features/keymaps.mdx) and [Config](config/index.md) documentation. If you get an error stating `Keymap node not found, check a keymap is available and is has compatible = "zmk,keymap" set` this is an indication that the build process cannot find the keymap. Double check that the `<keyboard>.keymap` file is present and has been discovered by the build process. This can be checked by looking for a line in the build log stating `-- Using keymap file: /path/to/keymap/file/<keyboard>.keymap`. Inside the keymap file ensure the keymap node has `compatible = zmk,keymap` and it's not misspelled. For more information see the [Keymap](keymaps/index.mdx) and [Config](config/index.md) documentation.
### Devicetree Errors ### Devicetree Errors
@ -58,5 +58,5 @@ Key positions are numbered starting from `0` at the top left key on the keymap,
::: :::
:::tip :::tip
A common mistake that leads to this error is to use [key press keycodes](behaviors/key-press.md) without the leading `&kp` binding. That is, having entries such as `SPACE` that should have been `&kp SPACE`. A common mistake that leads to this error is to use [key press keycodes](keymaps/behaviors/key-press.md) without the leading `&kp` binding. That is, having entries such as `SPACE` that should have been `&kp SPACE`.
::: :::

View file

@ -23,7 +23,7 @@ export const Uf2Tabs = (props) => (
); );
:::tip :::tip
[USB logging](../development/usb-logging.mdx) can be very helpful for diagnosing issues with ZMK. However, when connected to USB your ZMK device will output to USB by default. To troubleshoot wireless connection issues using logging, you will need to [change the preferred output endpoint](../behaviors/outputs.md). [USB logging](../development/usb-logging.mdx) can be very helpful for diagnosing issues with ZMK. However, when connected to USB your ZMK device will output to USB by default. To troubleshoot wireless connection issues using logging, you will need to [change the preferred output endpoint](../keymaps/behaviors/outputs.md).
::: :::
## Split Keyboard Halves Unable to Pair ## Split Keyboard Halves Unable to Pair
@ -139,7 +139,7 @@ This setting can also improve the connection strength between the keyboard halve
### Using Bluetooth Output With USB Power ### Using Bluetooth Output With USB Power
If you want to test Bluetooth output on your keyboard and are powering it through the USB connection rather than a battery, you will be able to pair with a host device but may not see keystrokes sent. In this case you need to use the [output selection behavior](../behaviors/outputs.md) to prefer sending keystrokes over Bluetooth rather than USB. This might be necessary even if you are not powering from a device capable of receiving USB inputs, such as a USB charger. If you want to test Bluetooth output on your keyboard and are powering it through the USB connection rather than a battery, you will be able to pair with a host device but may not see keystrokes sent. In this case you need to use the [output selection behavior](../keymaps/behaviors/outputs.md) to prefer sending keystrokes over Bluetooth rather than USB. This might be necessary even if you are not powering from a device capable of receiving USB inputs, such as a USB charger.
### macOS Connected but Not Working ### macOS Connected but Not Working

View file

@ -217,7 +217,7 @@ Please refer to [split keyboards documentation](features/split-keyboards.md) for
ZMK will automatically advertise itself as connectable if it is not currently connected to a device. You should be able to see your keyboard from the bluetooth scanning view of your computer or phone / tablet. It is reported by some users that the connections with Android / iOS devices are generally smoother than with laptops, so if you have trouble connecting, you could try to connect from your phone or tablet first to eliminate any potential hardware issues with bluetooth receivers. ZMK will automatically advertise itself as connectable if it is not currently connected to a device. You should be able to see your keyboard from the bluetooth scanning view of your computer or phone / tablet. It is reported by some users that the connections with Android / iOS devices are generally smoother than with laptops, so if you have trouble connecting, you could try to connect from your phone or tablet first to eliminate any potential hardware issues with bluetooth receivers.
ZMK supports multiple BLE “profiles”, which allows you to connect to and switch among multiple devices. Please refer to the [Bluetooth behavior](behaviors/bluetooth.md) section for detailed explanations on how to use them. If you don't make use of the mentioned behaviors you will have issues pairing your keyboard to other devices. ZMK supports multiple BLE “profiles”, which allows you to connect to and switch among multiple devices. Please refer to the [Bluetooth behavior](keymaps/behaviors/bluetooth.md) section for detailed explanations on how to use them. If you don't make use of the mentioned behaviors you will have issues pairing your keyboard to other devices.
### Connecting Split Keyboard Halves ### Connecting Split Keyboard Halves

View file

@ -31,70 +31,64 @@ module.exports = {
}, },
{ {
Features: [ Features: [
"features/keymaps",
"features/bluetooth", "features/bluetooth",
"features/split-keyboards",
"features/combos",
"features/conditional-layers",
"features/debouncing",
"features/displays",
"features/encoders",
"features/modules", "features/modules",
"features/underglow", "features/split-keyboards",
"features/backlight", "features/debouncing",
"features/battery", "features/battery",
"features/soft-off", "features/soft-off",
"features/displays",
"features/backlight",
"features/underglow",
], ],
}, },
{
type: "category",
label: "Keymaps",
link: {
type: "doc",
id: "keymaps/index",
},
collapsed: true,
items: [
{ {
type: "category", type: "category",
label: "Behaviors", label: "Behaviors",
link: { link: {
type: "doc", type: "doc",
id: "behaviors/index", id: "keymaps/behaviors/index",
}, },
collapsed: true, collapsed: true,
items: [ items: [
"behaviors/key-press", "keymaps/behaviors/key-press",
"behaviors/layers", "keymaps/behaviors/layers",
"behaviors/misc", "keymaps/behaviors/misc",
"behaviors/hold-tap", "keymaps/behaviors/hold-tap",
"behaviors/mod-tap", "keymaps/behaviors/mod-tap",
"behaviors/mod-morph", "keymaps/behaviors/mod-morph",
"behaviors/macros", "keymaps/behaviors/macros",
"behaviors/key-toggle", "keymaps/behaviors/key-toggle",
"behaviors/sticky-key", "keymaps/behaviors/sticky-key",
"behaviors/sticky-layer", "keymaps/behaviors/sticky-layer",
"behaviors/tap-dance", "keymaps/behaviors/tap-dance",
"behaviors/caps-word", "keymaps/behaviors/caps-word",
"behaviors/key-repeat", "keymaps/behaviors/key-repeat",
"behaviors/sensor-rotate", "keymaps/behaviors/sensor-rotate",
"behaviors/mouse-emulation", "keymaps/behaviors/mouse-emulation",
"behaviors/reset", "keymaps/behaviors/reset",
"behaviors/bluetooth", "keymaps/behaviors/bluetooth",
"behaviors/outputs", "keymaps/behaviors/outputs",
"behaviors/underglow", "keymaps/behaviors/underglow",
"behaviors/backlight", "keymaps/behaviors/backlight",
"behaviors/power", "keymaps/behaviors/power",
"behaviors/soft-off", "keymaps/behaviors/soft-off",
], ],
}, },
{ "keymaps/modifiers",
type: "category", "keymaps/combos",
label: "Codes", "keymaps/conditional-layers",
link: { "keymaps/encoders",
type: "doc", "keymaps/list-of-codes",
id: "codes/index",
},
collapsed: true,
items: [
"codes/keyboard-keypad",
"codes/modifiers",
"codes/editing",
"codes/media",
"codes/applications",
"codes/input-assist",
"codes/power",
], ],
}, },
{ {

View file

@ -4,11 +4,11 @@
* SPDX-License-Identifier: CC-BY-NC-SA-4.0 * SPDX-License-Identifier: CC-BY-NC-SA-4.0
*/ */
import example from "@site/docs/codes/_footnotes/example.mdx"; import example from "@site/docs/keymaps/_footnotes/example.mdx";
import iosApplication from "@site/docs/codes/_footnotes/ios-application.mdx"; import iosApplication from "@site/docs/keymaps/_footnotes/ios-application.mdx";
import iosPower from "@site/docs/codes/_footnotes/ios-power.mdx"; import iosPower from "@site/docs/keymaps/_footnotes/ios-power.mdx";
import macosPower from "@site/docs/codes/_footnotes/macos-power.mdx"; import macosPower from "@site/docs/keymaps/_footnotes/macos-power.mdx";
import globe from "@site/docs/codes/_footnotes/globe.mdx"; import globe from "@site/docs/keymaps/_footnotes/globe.mdx";
export default { export default {
example, example,

8
docs/static/_redirects vendored Normal file
View file

@ -0,0 +1,8 @@
/docs/behaviors/* /docs/keymaps/behaviors/:splat 301
/docs/features/keymaps /docs/keymaps 301
/docs/features/combos /docs/keymaps/combos 301
/docs/features/conditional-layers /docs/keymaps/conditional-layers 301
/docs/features/encoders /docs/keymaps/encoders 301
/docs/codes/* /docs/keymaps/list-of-codes 301
/docs/troubleshooting#split-keyboard-halves-unable-to-pair /docs/troubleshooting/connection-issues#split-keyboard-halves-unable-to-pair 301
/docs/features/beta-testing /docs/features/modules 301