Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added toggle-mode, allowing toggle-on and toggle-off #2555

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Nick-Munnich
Copy link
Contributor

@Nick-Munnich Nick-Munnich commented Oct 15, 2024

Added toggle-mode flag to both the key toggle and toggle layer behaviors. Toggle mode can be set to

  • "on"
  • "off"
  • "flip" (default when not present)

Tested locally with basic functionality. I don't see an edge case where this might cause issues.

Note that if key toggle on is spammed, it will repeatedly send over the "press" code.

Resolves #2523.

Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please add some tests that exercise this new functionality?

@Nick-Munnich
Copy link
Contributor Author

Can we please add some tests that exercise this new functionality?

Yeah, I was just thinking that. Going to do so (and fix an oopsie I noticed) and then undraft.

Copy link
Contributor

@caksoylar caksoylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://zmk.dev/docs/config/behaviors needs to be updated as well.

docs/docs/keymaps/behaviors/key-toggle.md Outdated Show resolved Hide resolved
docs/docs/keymaps/behaviors/layers.md Outdated Show resolved Hide resolved
app/dts/bindings/behaviors/zmk,behavior-toggle-layer.yaml Outdated Show resolved Hide resolved
app/src/behaviors/behavior_toggle_layer.c Outdated Show resolved Hide resolved
Copy link
Contributor

@caksoylar caksoylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on docs, and source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Layer behaviors to only enable or disable a layer instead of toggling
3 participants