How can I use xkb
to map a key combination like Super + Shift + C to another combination like Ctrl + Shift + C?
The question is about doing so with xkb
. I know about autokey
or xmodmap
but I want to do it with xkb
as other options aren't as stable as xkb
in current versions of X
.
Update
It'd be awesome if these mappings can be application specific. It'd be super awesome if these mappings could be system wide except some applications.
xkb_compatibility
clause to handle only this combination:interpret Super+Shift+Exactly(C) { action= SetMods(modifiers=Control); } // or similar
... – quixotic Jun 26 '18 at 10:08interpret
line? – Sassan Jun 26 '18 at 10:48.../xkb/compat/
directory? – Sassan Jun 26 '18 at 10:50interpret Super+Exactly(C) { action= SetMods(modifiers=Control); }
to.../xkb/compat/basic
made my xserver unable to startup. – Sassan Jun 26 '18 at 11:21xkbcomp
to create a base layout from your existing layout:xkbcomp $DISPLAY my-current.xkb
... edit the file and make changes there ... test withxkbcomp my-current.xkb $DISPLAY
... if it doesn't work, tweak the file and retry ... – quixotic Jun 26 '18 at 11:53Identifier "C" of type int is unknown
any idea? – Sassan Jun 26 '18 at 12:08Exactly(C)
may not be the appropriate way to specify that key. i'm guessing based on otherinterpret
clauses in my own keymap, but there aren't a lot ofExactly()
s in use. – quixotic Jun 26 '18 at 19:40