TL;DR
Under Wayland, can I somehow bind AltGr + C
to Ctrl + C
?
Details
I basically want to ask this question, but for GNOME on Wayland. This means that answers involving AutoKey and xbindkeys wont work, as neither works under Wayland.
Background
I would like to remap some keys to ultimately make better use of CapsLock
.
My plan is to map CapsLock
to AltGr
, and then follow this to obtain vim-like keybindings. On Wayland, this remapping can be done through XKB files (see the link).
However, I would also like to use CapsLock
for copy/pasting. Currently, I have it mapped to Ctrl
(using XKB files). This makes CapsLock + C
work smoothly throughout the system, and I would like to preserve this.
So: With CapsLock
mapped to AltGr
, I would like Capslock (= AltGr) + C
to act as Ctrl + C
.
My question
Under Wayland, can I somehow bind AltGr + C
to Ctrl + C
?
(Without just rebinding AltGr
to Ctrl
, as that would defeat the purpose)
An alternative example with Q
In the XKB file for latin /usr/share/X11/xkb/symbols/latin
, the following behavior is defined for my Q
key:
key <AD01> { [ q, Q, at, Greek_OMEGA ] };
This states that the key has four possible outputs:
- Pressed alone, it produces
q
. - Pressed with
Shift
, it producesQ
. - Pressed with
AltGr
, it produces@
. - Pressed with
AltGr + Shift
, it producesΩ
.
Essentially what I would like to achieve is that when Q
is pressed with AltGr
, it does not produce @
but Ctrl + Q
.