I use every single key on my laptop keyboard, with not one to spare. I recently got a Thinkpad T14 gen 5, which has a copilot key where PrtSc used to be. I was hoping to rebind the copilot key to be PrtSc (which I use heavily to resize windows), or at least map it to something (F23?) that I could intercept with my window manager for the same purposes.
Unfortunately, when I use showkey -s, pressing the copilot key gives 0xe0 0x5b 0x2a, and releasing 0xaa 0xe0 0xdb. I verified that 0xe0 0x5b / 0xe0 0xdb is just what I get for pressing / releasing the left windows key, and 0x2a / 0xaa is what I get for pressing / releasing the left shift key. So there doesn't seem to be a unique scan code for the copilot key.
If I use evtest, I get the following events from pressing/releasing copilot:
Event: time 1733647696.413560, type 4 (EV_MSC), code 4 (MSC_SCAN), value db Event: time 1733647696.413560, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 1 Event: time 1733647696.413560, -------------- SYN_REPORT ------------ Event: time 1733647696.413794, type 4 (EV_MSC), code 4 (MSC_SCAN), value 2a Event: time 1733647696.413794, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1 Event: time 1733647696.413794, -------------- SYN_REPORT ------------ Event: time 1733647696.413922, type 4 (EV_MSC), code 4 (MSC_SCAN), value 6e Event: time 1733647696.413922, -------------- SYN_REPORT ------------ Event: time 1733647696.519973, type 4 (EV_MSC), code 4 (MSC_SCAN), value 6e Event: time 1733647696.519973, -------------- SYN_REPORT ------------ Event: time 1733647696.520192, type 4 (EV_MSC), code 4 (MSC_SCAN), value 2a Event: time 1733647696.520192, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0 Event: time 1733647696.520192, -------------- SYN_REPORT ------------ Event: time 1733647696.520475, type 4 (EV_MSC), code 4 (MSC_SCAN), value db Event: time 1733647696.520475, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 0 So there is some kind of event unique to pressing copilot (namely MSC_SCAN 0x6e), but this doesn't seem to yield a corresponding keyscan event I can put into a keyboard map to load with loadkeys. If I could map that 0x6e event to F23, I could just have my window manager do the equivalent of the Print key on Win-Shift-F23, but I don't know how to do this.
My questions:
- What is the relationship between the EV_MSC event values returned by evtest and the scan codes returned by
showkey -s? - Is there some way to get the kernel to generate a key event from this
EV_MSC 6eevent? Can I do this with a keymap andloadkeys, or is there something lower-level I need to do? - Are there any other ways to be able to intercept the copilot key in my window manager to resize windows?