8

My new laptop features the new windows copilot key instead of the normal right CTRL key.

How to remap this key under modern Linux/Gnome/Wayland?

The key does not send one scancode but sends left-Shift + Windows key + F23 simultaneously.

I attempted to learn about Linux key mappings, but I'm unclear on how they work with three keys pressed simultaneously. Additionally, I'm uncertain which subsystem is best to modify for this purpose in 2024, particularly with a modern setup using Fedora 40, GNOME 46, and Wayland.

karl
  • 1,050
  • 4
  • 11
Tristan
  • 83

5 Answers5

5

With keyd I was able to remap the copilot key. Here is the relevant config.

f23+leftshift+leftmeta = overload(control, esc)
Joshua
  • 194
0

In my case with a HP ZBook laptop, pressing the Copilot key sends a combination of left-meta + left-shift very quickly (within 2ms): press left-meta, press left-shift, release left-shift, release left-meta. Releasing the Copilot key does nothing.

I used kmonad to remap Copilot key to a sticky right-ctrl, which seems to work fine:

(defsrc
  lmet
  lsft
  )

(deflayer base ;; LMETA gets pressed, this could be due to either Copilot, or a normal press. (around-next-timeout 2 ;; Change to remap-copilot layer for 2ms. If it's the Copilot key, ;; the next LSHIFT will cause RCTRL from that layer to get pressed. (layer-toggle remap-copilot) ;; Otherwise, behave as a sticky key. ;; Note that you can't put LMETA alone here, as around-next-timeout ;; will tap this key instead of pressing. (sticky-key 500 lmet)) ;; LSHIFT has no use here _ )

(deflayer remap-copilot _ _ (sticky-key 500 rctl))

0

I used keyd with the following config:

[ids]
*

[main] f23+leftshift+leftmeta = layer(control)

layer(control) seems to be better than overload(control, esc) suggested in the accepted answer, because the latter apparently means "Ctrl when held, Esc on tap", which isn't exactly what we want.

0

As some users has answer before, for ubuntu using keyd works, the only thing for me (using ubuntu on a Lenovo loq 15) is that if i used overload(control, esc) or layer(control), the system takes that as left ctrl.

Depending of what you really want I recommend use the command:

man keyd

to read a bit and find exactly what is the use of "layer" and "overload" as funtction, as for me I just want to use the copilot as right ctrl. So this is my configuration:

[ids]

[main] f23+leftshift+leftmeta = rightcontrol

-1

I'm sorry, being new I cannot comment, but the answer provided above (by Joshua), which is also the accepted answer, works very well also on my Lenovo Legion 5 Laptop.

George
  • 1