keyd icon indicating copy to clipboard operation
keyd copied to clipboard

How can I toggle Sticky Keys with a shortcut?

Open madorian opened this issue 6 months ago • 3 comments

Can I toggle sticky keys with something like CTRL+Q?

I found this sticky config:

 [ids]
     
    *
     
    # Latching (first press activates modifier's layer for next key)
     
    [main]
    capslock = oneshot(control)
    control = oneshot(control)
    shift = oneshot(shift)
    leftalt = oneshot(alt)
    rightalt = oneshot(alt)
    meta = oneshot(meta)
     
    # Locking (second press locks modifier until pressed again)
     
    [control]
    control = toggle(control)
    capslock = toggle(control)
     
    [shift]
    shift = toggle(shift)
     
    [alt]
    leftalt = toggle(alt)
    rightalt = toggle(alt)
     
    [meta]
    meta = toggle(meta)

madorian avatar Jun 09 '25 20:06 madorian

Sure:

[sticky] capslock = oneshot(control) control = oneshot(control) shift = oneshot(shift) leftalt = oneshot(alt) rightalt = oneshot(alt) meta = oneshot(meta)

[control] q = toggle(sticky)

On June 9, 2025 10:42:18 PM GMT+02:00, madorian @.***> wrote:

madorian created an issue (rvaiya/keyd#1030)

Can I toggle sticky keys with something like CTRL+Q?

I found this sticky config:

[ids]
    
   *
    
   # Latching (first press activates modifier's layer for next key)
    
   [main]
   capslock = oneshot(control)
   control = oneshot(control)
   shift = oneshot(shift)
   leftalt = oneshot(alt)
   rightalt = oneshot(alt)
   meta = oneshot(meta)
    
   # Locking (second press locks modifier until pressed again)
    
   [control]
   control = toggle(control)
   capslock = toggle(control)
    
   [shift]
   shift = toggle(shift)
    
   [alt]
   leftalt = toggle(alt)
   rightalt = toggle(alt)
    
   [meta]
   meta = toggle(meta)

-- Reply to this email directly or view it on GitHub: https://github.com/rvaiya/keyd/issues/1030 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

nsbgn avatar Jun 09 '25 20:06 nsbgn

This doesn't work as expected.

C-q should turn on the sticky layer and C-q again should turn off the sticky layer.

Or any other suggestions?

Right now, I'm not sure what it's supposed to do and I just to stop keyd over ssh, cause it just outputted weird stuff;)

madorian avatar Jun 15 '25 20:06 madorian

C-q should turn on the sticky layer and C-q again should turn off the sticky layer.

This is what the above config is supposed to do. Can you please explain what happens instead?

lobre avatar Jun 16 '25 06:06 lobre

Can you send the complete configuration file, cause I'm not really sure how this is supposed to switch between a totally normal keyboard and a sticky keyboard.

madorian avatar Jun 24 '25 20:06 madorian