zmk-auto-layer icon indicating copy to clipboard operation
zmk-auto-layer copied to clipboard

Having &num_word on the same layer as num layer does not work

Open sidcha opened this issue 8 months ago • 4 comments

I have a slightly customised Miryoku layout where the numbers on a separate layer. Right hand thumb key activates the numbers layer and all numbers are on the left half. The right half has only the home row modifier keys mapped. I wanted to have a num_word key mapped to a key on the same layer (on the right half) so I can go to the num layer, activate the num_word and then stay locked in this layer for as long as keys in the continue list are entered and then go back to default layer.

You can see my attempt to do this here but it doesn't work as expected -- pressing the &num_word key has no observable effect.

Then, I moved they &num_word key to the nav layer (here) and then it works as documented.

So basically, my question would be: is there any implied relation to the layer number and activation key placement layer?

sidcha avatar Apr 10 '25 16:04 sidcha

Thanks for reporting, can you describe what's happening? Also a link to your keymap could be useful.

urob avatar Apr 11 '25 12:04 urob

Sorry about the terse issue description; I was too sleepy then and did a sloppy job :)

Fixed that now by editing the original comment for better visibility.

sidcha avatar Apr 11 '25 14:04 sidcha

Thanks for clarifying. The issue is that when you release your right thumb, it is deactivating the numbers layer. (Holding &lt resolves to &mo which sends zmk_keymap_layer_deactivate when being released).

I don't see an easy way to prevent this with the current ZMK API.

However, there is an open PR which adds a locking property to layers (https://github.com/zmkfirmware/zmk/pull/2717). If that gets merged, we could add an "lock" option for auto-layers that prevents them getting deactivated by other behaviors.

urob avatar Apr 11 '25 17:04 urob

Make sense, thanks for the explanation.

sidcha avatar Apr 11 '25 17:04 sidcha

This should be fixed in b1b4b1c.

For now, the commit is only in next. It will get merged into main once ZMK v0.4 gets released. If you want to try it out now, you could build against the development branches of both repos:

manifest:
  remotes:
    - name: zmkfirmware
      url-base: https://github.com/zmkfirmware
    - name: urob
      url-base: https://github.com/urob
  projects:
    - name: zmk
      remote: zmkfirmware
      revision: main
      import: app/west.yml
    - name: zmk-auto-layer
      remote: urob
      revision: next
  self:
    path: config

urob avatar Nov 15 '25 19:11 urob

Thanks @urob. I was watching that PR. Will give this a try soon and report back.

sidcha avatar Nov 15 '25 19:11 sidcha

Works exactly as I wanted. Thank you very much.

sidcha avatar Nov 26 '25 14:11 sidcha