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

Merged
merged 2 commits into from
Dec 13, 2024

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.

@Nick-Munnich Nick-Munnich requested review from a team as code owners October 15, 2024 22:27
@Nick-Munnich Nick-Munnich marked this pull request as draft October 15, 2024 22:55
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.

@Nick-Munnich Nick-Munnich force-pushed the toggle-mode branch 2 times, most recently from c8ddadf to 4ac5b3c Compare October 15, 2024 23:56
@Nick-Munnich Nick-Munnich marked this pull request as ready for review October 16, 2024 00:03
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.

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.

LGTM! Thanks!

@petejohanson petejohanson merged commit 4ef231f into zmkfirmware:main Dec 13, 2024
49 checks passed
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