rvaiya / keyd

A key remapping daemon for linux.
MIT License
2.78k stars 166 forks source link

Use both control keys to swap layout #819

Open ddffnn opened 1 month ago

ddffnn commented 1 month ago

I'm trying to implement behavior just like grp:ctrls_toggle in xkb. I've tried the below config, but can only enter the dvorak layout, that is, I can't get back to the main layout. It looks like composite layers don't work with a layout. Is there any other way to know that dvorak is active so setlayout(main) can be bound instead? Or should togglelayout() exist?

include layouts/dvorak

[ids]
*

[main]
# see https://github.com/rvaiya/keyd/issues/209#issuecomment-1121386837
rightcontrol = rightcontrol

[control]
rightcontrol = setlayout(dvorak)
leftcontrol = setlayout(dvorak)

[control+dvorak]
rightcontrol = setlayout(main)
leftcontrol = setlayout(main)