keyd icon indicating copy to clipboard operation
keyd copied to clipboard

mapping capslock

Open dagimg-dot opened this issue 1 year ago • 2 comments

I mapped capslock + f to ctrl + v (paste) and also i mapped caplock + e to ctrl only when pressed like this

[capslock:C] f = C-v e = layer(control)

now what i want is when i press capslock + e + f to work like ctrl + f since capslock + e is ctrl. how can i achieve that. currently when i press capslock + e + f it performs capslock + f which is ctrl + v

dagimg-dot avatar Aug 20 '24 08:08 dagimg-dot

[main]
capslock = layer(capslock)

[capslock:C]
f = C-v
e = layer(control)

[capslock+control]
f = C-f

nsbgn avatar Aug 20 '24 10:08 nsbgn

Thank you it works for f

one more question. Can i make capslock+e to behave like ctrl for all cases without losing what i have now. like all comibinations with ctrl will work when i hold capslock + e. currently it works only for f like you gave me above

[main]
capslock = layer(capslock)

[capslock:C]
f = C-v
e = layer(control)

[capslock+control]
f = C-f

dagimg-dot avatar Aug 20 '24 12:08 dagimg-dot

Can i make capslock+e to behave like ctrl for all cases without losing what i have now

No, I believe you will have to explicitly remap each key. keyd is designed so that stacked modifier layers will apply mods to the upper most layer with an explicit binding. I would reconsider whether or not you really want to do this in the first place.

rvaiya avatar Dec 28 '24 20:12 rvaiya

Well, you could do:

[main]
capslock = layer(capslock)

[capslock:C]
f = C-v
e = swap(control)

although there are some subtly different behaviours then (see the manpage for details on swap)

nsbgn avatar Dec 29 '24 10:12 nsbgn