diff options
author | Forrest Cahoon <forrest.cahoon@gmail.com> | 2022-05-31 06:31:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-31 21:31:47 +1000 |
commit | 8153b55e07acb2dff9895b98eb9d9ca3161afb5a (patch) | |
tree | e970a93f31c99094730a419b1d30201052ad9df9 /docs | |
parent | d5ed3ae9676aeea4cfd4d58ba1fe0b20936ae658 (diff) | |
download | qmk_firmware-8153b55e07acb2dff9895b98eb9d9ca3161afb5a.tar.gz qmk_firmware-8153b55e07acb2dff9895b98eb9d9ca3161afb5a.zip |
Add trailing parens to `get_oneshot_mods` in feature_advanced_keycodes.md (#17211)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/feature_advanced_keycodes.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 36b81a4e8e..83066187c7 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -39,7 +39,7 @@ In practice, this means that you can check whether a given modifier is active wi To check that *only* a specific set of mods is active at a time, AND the modifier state and your desired mod mask as explained above and compare the result to the mod mask itself: `get_mods() & <mod mask> == <mod mask>`. -For example, let's say you want to trigger a piece of custom code if one-shot left control and one-shot left shift are on but every other one-shot mods are off. To do so, you can compose the desired mod mask by combining the mod bits for left control and shift with `(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT))` and then plug it in: `get_oneshot_mods & (MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT)) == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT))`. Using `MOD_MASK_CS` instead for the mod bitmask would have forced you to press four modifier keys (both versions of control and shift) to fulfill the condition. +For example, let's say you want to trigger a piece of custom code if one-shot left control and one-shot left shift are on but every other one-shot mods are off. To do so, you can compose the desired mod mask by combining the mod bits for left control and shift with `(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT))` and then plug it in: `get_oneshot_mods() & (MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT)) == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT))`. Using `MOD_MASK_CS` instead for the mod bitmask would have forced you to press four modifier keys (both versions of control and shift) to fulfill the condition. The full list of mod masks is as follows: |