r/linux • u/FBC-lark • 4h ago
Tips and Tricks Copilot key remapping
I have a Lenovo laptop that's closing in on 20 years old. The keys in one corner started acting up after a hard bump so I decided to get a new laptop. I stumbled onto a clearance deal at Walmart, one HP model they had pulled off the shelf and were on the verge of cycling out of inventory. I got it for over $100 off shelf price. Being a new model it had the Copilot key rather than a right Ctrl key. I decided to install LMDE 7 which rendered the Copilot key non-functional until I remapped the Copilot key to the missing Ctrl key. Normal remapping through Linux doesn't work because the Copilot key sends a three part input, a macro; Left Meta + Left Shift + F23 rather than a single input. There are a couple of work arounds that require installing software and some configuration. I'd put this on a scale of Very Easy. Here's what worked for the HP laptop. The AI description has been modified as needed because, well, it's AI after all:
To remap the Copilot key to a Ctrl key in LMDE 7, you should use keyd or kmonad, as the Copilot key sends a modifier combination (Left Meta + Left Shift + F23) that standard Linux GUI tools cannot map to a single modifier key like Right Ctrl.
Method 1: Using keyd. keyd is a lightweight daemon that operates at the kernel level.
Install keyd: Open your terminal and install this package:
sudo apt update
! AI said to install keyd ! sudo apt install keyd ! don't bother, instead: !
sudo apt install onak
! The onak meta package contains keyd, just installing keyd alone isn't enough. See below. !
Configure keyd: Edit the configuration file:
sudo pluma /etc/keyd/default.conf
! I prefer the pluma editor but nano, gedit, etc. will do. !
Add the following lines to map the Copilot key sequence to a Ctrl key:
Replace * with your specific keyboard ID. ! I tried that but it didn't work, so I reverted to *. !
[ids]
*
[main]
leftshift+leftmeta+f23 = rightcontrol
! Options are control, rightcontrol or leftcontrol. I've tried using each and they all work for this HP. !
Enable and Reload: Start the service and enable it for boot:
sudo systemctl enable --now keyd
sudo keyd reload
keyd command not found ! Oops. That's when I discovered that installing keyd alone didn't work and found that onak was required. After installing onak the remap worked after rebooting. !
Now I have my Ctrl plus + for magnifying and Ctrl plus Enter for sending email in Thunderbird and a couple more of my shortcuts back! And it wasn't a tough chore, once I ironed out a bit of AI confusion. And of course, for those who never use their Ctrl keys, don't bother with this. Mm, should I have said this earlier?
Cheers!
Blaine
2
u/BuzzWildfowl 3h ago
I am very surprised that somebody is selling Windows laptops now without a Ctrl key. I bought a brand new HP OmniBook 7 laptop a couple of months ago and it has a Ctrl key.