You are not logged in.
Pages: 1
My new laptop features a "Copilot" key instead of a right Windows key. I'm trying to figure out how to re-bind/remap this key using xmodmap.
The issue is that the physical key seems to produce two keycodes:
libinput debug-events produces:
-event4 KEYBOARD_KEY +0.000s KEY_LEFTMETA (125) pressed
event4 KEYBOARD_KEY +0.002s *** (-1) pressed
event4 KEYBOARD_KEY +0.105s *** (-1) released
event4 KEYBOARD_KEY +0.113s KEY_LEFTMETA (125) released
libinput debug-events --show-keycodes produces:
-event4 KEYBOARD_KEY +0.000s KEY_LEFTMETA (125) pressed
event4 KEYBOARD_KEY +0.003s KEY_LEFTSHIFT (42) pressed
event4 KEYBOARD_KEY +0.131s KEY_LEFTSHIFT (42) released
event4 KEYBOARD_KEY +0.138s KEY_LEFTMETA (125) released
showkeys produces:
keycode 125 press
keycode 42 press
keycode 42 release
keycode 125 release
Is there a way to have X11 register this as one key (the Windows key), or alternatively, have i3 recognize this combination as an alias for the Mod4 key (while still keeping the Mod4/Windows key as well)?
Last edited by jay-tux (2024-12-03 08:44:14)
Offline
The key seems to fake shift+meta, you'll not be able to turn this into anything else (ie. you could probably map lshift+meta_l to meta_r but pressing shift+meta using the actual keys on the left side would then do the same.
=> Bind the desired shortcuts to shift+meta+x ?
Offline
=> Bind the desired shortcuts to shift+meta+x ?
You mean duplicating each keybind in my i3-config?
Offline
Ah, you want the right meta key to behave the same as the left meta key?
But you're likely not ready to entirely sacrifice shift+meta?
If you cannot alter the key behavior in the firmware you'll likely end up having to duplicate the entries - there's no way for the OS to tell whether the event came from you pushing the two left keys or the one right key (arguebly one could have a device driver noticing that the keys came in <5 ms and figure: ok, that's not the humanoid, I'll map that somewhere else) but this is very specific and I'm not aware of some libinput feature for that.
If the copilot keys all end up doing this, it might be worth a request at libinput.
Offline
Oh, I'm totally fine "merging" left and right meta into one, or having the system treat shift+meta as meta.
My config doesn't use Shift+Meta anywhere (as far as I'm aware).
Can I have i3 treat both L_META and SHIFT+R_META as Mod4?
Offline
https://wiki.archlinux.org/title/Input_remap_utilities
keyd is in the repos
Offline
Alright, after messing around, I found a solution. Thanks, seth!
For those curious: this is the resulting keyd config:
[ids]
*
[main]
[meta]
shift = layer(meta)
Offline
\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline
Pages: 1