Skip to content

Instantly share code, notes, and snippets.

@daemonp
Last active May 20, 2026 11:08
Show Gist options
  • Select an option

  • Save daemonp/b3894f5b0f8b1d17bb03fe98eb53b723 to your computer and use it in GitHub Desktop.

Select an option

Save daemonp/b3894f5b0f8b1d17bb03fe98eb53b723 to your computer and use it in GitHub Desktop.

Dell XPS 14 (Copilot Key → Right Ctrl)

There exists a "copilot" button between Right Alt and the left arrow. Also called the "i" key, menu key, whatever.

MS decided to make it send Left Meta + Left Shift + F23 all at once instead of just one clean keypress so traditional scancode hwdb could handel.

keyd

keyd grabs the keyboard at the evdev level, sees that exact three-key chord, and spits out a clean Right Ctrl instead.

Arch:

yay -S keyd

/etc/keyd/default.conf:

[ids]
*

[main]
# Copilot key garbage
leftmeta+leftshift+f23 = rightcontrol
sudo keyd reload
sudo systemctl enable --now keyd

keyd's virtual keyboard gets treated like an external one by default, so palm rejection and "disable touchpad while typing" stop working. Fix it with a libinput quirk.

Create /etc/libinput/local-overrides.quirks:

[Serial Keyboards]
MatchUdevType=keyboard
MatchName=keyd virtual keyboard
AttrKeyboardIntegration=internal

Apply it:

sudo udevadm control --reload-rules
sudo udevadm trigger

Check it worked:

event=$(grep -l "keyd virtual keyboard" /sys/class/input/event*/device/name | head -1 | grep -oP 'event\d+')
sudo libinput quirks list "/dev/input/$event"

Should return AttrKeyboardIntegration=internal

Verify

Run sudo evtest, pick the keyd virtual keyboard, and mash the Copilot key. You should only see clean Right Ctrl events. No Meta, no Shift, no F23 nonsense.

Alternative if you don't want keyd running all the time

mishoo/exorcise-copilot. Smaller C++ tool that does the same grab-and-rewrite trick. Still need the libinput quirk though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment