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 Request: Layer Lock Key #1771

Open
kvietcong opened this issue Apr 21, 2023 · 8 comments · May be fixed by #1984
Open

Feature Request: Layer Lock Key #1771

kvietcong opened this issue Apr 21, 2023 · 8 comments · May be fixed by #1984

Comments

@kvietcong
Copy link

kvietcong commented Apr 21, 2023

Hi, I'm coming from QMK and there was a userspace library that was incredibly helpful: https://getreuer.info/posts/keyboards/layer-lock/index.html. It allows you to lock a layer when you are accessing it through some temporary means. So if you had a momentary layer key, holding that down and then pressing this layer lock key would essentially toggle it on. The blog post I linked goes into more depth. It also has the C implementation linked, which is under the Apache license. However, it is in a repo with GPL code (a QMK repo).

This is similar to #1299 but a &df solution (changing the default layer just to lock a layer temporarily) seems too heavy handed.

@petejohanson
Copy link
Contributor

Note: since QMK code is GPL, it should not be used as a reference when developing ZMK features. It is important that we honor the terms of the GPL license chosen by QMK.

See https://zmk.dev/docs/development/clean-room

@kvietcong
Copy link
Author

@petejohanson The code I linked is user code rather than QMK core code and uses a different license (Apache 2.0). Should I still remove the code link and just have the blogpost link that explains how it works at a high level?

@petejohanson
Copy link
Contributor

@petejohanson The code I linked is user code rather than QMK core code and uses a different license (Apache 2.0). Should I still remove the code link and just have the blogpost link that explains how it works at a high level?

Ideally, yes, using the description of the behavior is best.

@bmijanovich
Copy link

I posted an example of how to achieve this on #1299 here: #1299 (comment)

@kvietcong
Copy link
Author

kvietcong commented Aug 12, 2023

Thanks for the suggestion @bmijanovich. Sadly, I can't seem to get it working with my setup that heavily revolves around sticky layer keys.

@bmijanovich
Copy link

Happy to try to help troubleshoot if you want.

@kvietcong
Copy link
Author

kvietcong commented Aug 12, 2023

I was actually able to get it working with another day of troubleshooting. Thanks for the offer though! I uploaded my solution on this branch of my config: https://github.com/kvietcong/zmk-config/blob/layer-lock/config/the_abyss.keymap

I did some things to try cutting down on the config noise and it works for the most part. However, this method doesn't work really well with the nice!view display and does feel a little jank with the extra noise in the config. I still appreciate the workaround though!

I will still keep this issue open as I do feel this issue warrants a dedicated feature rather than a conditional layer workaround. It'd be super nice to just have a key to lock all layers currently activated instead of defining three layers for every one functional layer.

@bmijanovich
Copy link

I totally agree this should be a built-in feature. I'm actually wondering if there's a way to restrict the nice!view to only look at the first several layers to resolve this in the meantime. I have a lot of layers in my keymap for this sort of thing and it would be useful to mask them out somehow for displays.

@ecstatic-morse ecstatic-morse linked a pull request Nov 2, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants