keyd icon indicating copy to clipboard operation
keyd copied to clipboard

Feature request: chord aliases (or, how do I concisely remap a chord in multiple layers?)

Open ntc2 opened this issue 5 months ago • 4 comments

I have a ThinkPad Gen 5 P14s Intel with this annoying new "Windows Copilot" key that sends leftmeta+leftshift+f23 by default (e.g. https://github.com/rvaiya/keyd/issues/1025), and I want to treat it as a regular win key. I also want the oneshot and toggle behavior for the win key (I use it to control my window manager, xmonad), but it seems I need to remap the leftmeta+leftshift+f23 combo in all layers. This wasn't difficult to do once I understood the solution, but was confusing to figure out as a new keyd user. If I could simply remap leftmeta+leftshift+f23 as another meta alias, it would be less confusing.

Here is a working config file that accomplishes what I want, and additionally remaps the menu key compose in the same way (my laptop keyboard has a copilot key between right alt and right control, and my external keyboard has a menu key between right alt and right control, and I want to treat them as win keys). Compare how I can use an alias for compose, but not for leftmeta+leftshift+f23:

[ids]

*

[aliases]

# Doesn't work: doesn't do anything.
#leftshift+leftmeta+f23 = meta

# This works: makes all my other `meta` rules apply to `compose`.
compose = meta

[main]

meta = oneshot(meta)
leftshift+leftmeta+f23 = oneshot(meta)

[meta]

meta = toggle(meta)
leftshift+leftmeta+f23 = toggle(meta)

ntc2 avatar Jul 28 '25 02:07 ntc2

I apologize if I am mistaken, but the meta layer exists by default. How about using another name (such as META)?

tkna91 avatar Aug 10 '25 09:08 tkna91

I apologize if I am mistaken, but the meta layer exists by default. How about using another name (such as META)?

I'm not sure I understand: I thought the win key was mapped to the meta layer by default. My goals here are:

  1. have the copilot key treated like another win key.
  2. enable oneshot and toggle for both win keys.

ntc2 avatar Aug 12 '25 08:08 ntc2

It means something like changing A to B. I apologize if I am mistaken, but I understand that the name specified as an alias must avoid existing key names and layer names.

# A

[aliases]
# Doesn't work: doesn't do anything.
#leftshift+leftmeta+f23 = meta
# B

[aliases]
leftshift+leftmeta+f23 = copilot

[main]
copilot = oneshot(meta)

tkna91 avatar Aug 12 '25 09:08 tkna91

No, looking at the examples in the manual, that doesn't seem to be the case. Sorry.

https://github.com/rvaiya/keyd/blob/931a8060905b8fd80c83afbe059c22faa0811d03/docs/keyd.scdoc#L478

tkna91 avatar Aug 12 '25 09:08 tkna91