Remapping Copilot Key to END Key (And Others)
This was a bit of a frustrating journey, so writing it up here in case it helps others running into the same frustration.
I’ve become accustomed to remapping the two keys immediately to the right of the spacebar on my keyboards to HOME
and END
(in that order). Usually that means mapping the Right ALT
key to HOME
and the Windows Menu (or right-click context menu) key to END
. However, my two newer laptops replaced the latter button and introduced a new Copilot
button. It turns out that one hasn’t been as straightforward to remap, but I did finally find a way.
The only way I’ve gotten it to work so far is to use Microsoft PowerToys. Once installed, follow these instructions to get it set up:
- Open up PowerToys settings
- Expand the
Input / Output
section - Select the
Keyboard Manager
tool - Turn on the
Enable Keyboard Manager
option - Click on
Remap a shortcut
which will open a new window - Click on the
+ Add shortcut remapping
- Click the pencil icon on the left side
- Press the
Copilot
key on your keyboard - Click on the
OK
button to go back to theRemap shortcuts
screen - Click on the pencil icon in the center of the window (under the
To:
heading) - Press the
END
key on your keyboard (including any additional keys you need such as Fn on many laptops) - Click on the
OK
button to go back again - Click on the
OK
button in the top right of theRemap shortcuts
window - You’re likely to get a warning message of some kind, but it should be okay to ignore (e.g., something about the
F23
key not being mapped)
You should be good now. In my case, I also remapped the Right ALT key to HOME. That one can be done by just using the Remap a key
feature, so it’s a little bit simpler. In the end, you’ll end up with the following:
More about the journey
You’ll notice in the screenshot that the Copilot key maps to Left Windows + Left Shift + F23
key combo. I first tried to just update my AutoHotkey script that I use on all of my PCs to map that combo to End by simply adding a line such as #<+F23::END
to it. However, it seems a SHIFT key would still keep getting through which meant instead of just an END
, I’d get a SHIFT
+END
combination. That means that Windows would select the text between where the caret started off and the end of that line instead of simply moving the caret to the end of the line.
That led me to see if PowerToys would work. Less than ideal as it’s nicer to keep all of this kind of config consolidated in one simple script I already have working on all of my machines, but still worth trying. I tried using the Remap a key
support to map it (just like I described doing for the RALT
->HOME
key above), and it resulted in the same selection behavior I ran into with AutoHotkey.
Somewhere along the way, I decided to try using the other Remap a shortcut
feature instead. And it worked beautifully. Unfortunately, this took me several hours across an evening, a night’s sleep, and the following morning to discover. I was determined to figure out a way to make it work even picturing myself having to write some lower level Win32 code (which has been ages since I did that) as I really couldn’t see how this would be impossible to do. I still may end up spending some more time on seeing if I can get AutoHotkey to work for this case, but we’ll see. For now, I’m just going to enjoy this little victory that would have driven me nuts for a long time to come.