#2153·kanata

Feature request: `one-shot-toggle` variant

Author: ABDsheikhoCreated Aug 10, 2026Updated Sep 8, 2026
LabelsenhancementquestionPRs welcome

Is your feature request related to a problem? Please describe.

No. But here's a description of the feature.. Using keys to do apply a one shot layer can sometimes require to lock the layer after a few key-presses.

So, a one-shot-toggle shall do the following:

  • pressing/holding the key activate the layer for a one shot action.
  • pressing the same key again, will lock the layer associated with that key.
  • pressing it for a third time, release the layer back to the base layer.

Describe the solution you'd like.

Currently I'm doing a hack using virtual keys, as follow:

lisp
(defsrc
  102d    h    j    k    l
)

(deflayer base
  @navky  h    j    k    l
)

(deflayer nav
  @navlk  lft  down up   rght
)

(defalias
  navky (one-shot-press 2000 (layer-while-held nav))
  navlk (on-press toggle-virtualkey navLock)
)

(defvirtualkeys
  navLock (layer-while-held nav)
)

Describe alternatives you've considered.

Documenting my hack :)

Additional context

NOTE: I don't think this feautre can work with anything else other that layers (meaning keys, actions, etc.)