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

Feature: Layer toggle #98

Merged
merged 5 commits into from Aug 18, 2020
Merged

Conversation

BrainWart
Copy link
Contributor

@BrainWart BrainWart commented Aug 18, 2020

Usage:

&tog LOWER



Should I include how to use it to raise/lower in the documentation?

@petejohanson petejohanson linked an issue Aug 18, 2020 that may be closed by this pull request
Copy link
Contributor

@petejohanson petejohanson left a comment

Thanks for the PR! A few minor items.

@@ -0,0 +1,9 @@
/ {
Copy link
Contributor

@petejohanson petejohanson Aug 18, 2020

Choose a reason for hiding this comment

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

We've not been consistent here, but please add the copyright + license notice to the header here.

{
LOG_DBG("position %d layer %d current %d", position, layer, zmk_keymap_layer_active(layer));

if (zmk_keymap_layer_active(layer))
Copy link
Contributor

@petejohanson petejohanson Aug 18, 2020

Choose a reason for hiding this comment

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

Instead of putting this logic here, I would rather we create a nicer API for the keymap, this behavior can call into, e.g. make this code just do:

return zmk_keymap_layer_toggle(layer);

And then move this business logic into keymap.c.

app/src/behaviors/behavior_toggle_layer.c Show resolved Hide resolved
@petejohanson
Copy link
Contributor

petejohanson commented Aug 18, 2020

Should I include how to use it to raise/lower in the documentation?

@BrainWart It might be nice to give a "Usage Ideas" or "Normal Usage" section after the example, yeah. That'd be nice.

@petejohanson petejohanson added behaviors enhancement New feature or request labels Aug 18, 2020
Copy link
Contributor

@petejohanson petejohanson left a comment

One minor item left.

app/src/keymap.c Show resolved Hide resolved
Copy link
Contributor

@petejohanson petejohanson left a comment

Sweet! Thanks for the new behavior.

@petejohanson petejohanson merged commit c667be1 into zmkfirmware:main Aug 18, 2020
1 check passed
MangoIV referenced this pull request in MangoIV/zmk Dec 18, 2020
tyalie pushed a commit to tyalie/zmk that referenced this pull request Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behaviors enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants