Config XKB to map a key combination to another
wettstae at gmail.com
wettstae at gmail.com
Mon Jun 4 16:21:49 UTC 2018
> I'm trying to create a bunch of mappings like this:
> `Hyper+Shift+C` -> `Ctrl+Shift+C`
> `Hyper+Left` -> `Alt+Left`
> `Alt+Left` -> `Ctrl+Left`
> `Super+Left` -> `Home`
> How can I do it in xkb config files?
You can change the modifiers with Redirect actions. For example, for
the LEFT key, use something similar to this (untested, assuming Alt =
Mod1, Super = Mod4, and Hyper = Mod2):
key <LEFT> {
type = "ALT_SUPER_HYPER",
symbols = [ Left, Left, Left, Left, Left, Left, Left, Left ],
actions = [ NoAction(), RedirectKey(key=<LEFT>, clearMods=Mod1, mods=Control),
RedirectKey(key=<HOME>, clearMods=Mod4), NoAction(),
RedirectKey(key=<LEFT>, clearMods=Mod2, mods=Mod1), NoAction(),
NoAction(), NoAction() ]
}
The type ALT_SUPER_HYPER above you must provide as well; I assumed that
it is a eight level key with Alt as level 2 shift, and Super and Hyper
as Level 3 and Level 5 shift, respectively. If you have a look in
directory xkb/types, you certainly will figure out how that works. The
only thing special is that you should use `preserve` for all modifier
combinations; you can see preserve in action in file xkb/types/level5.
Andreas
More information about the xorg
mailing list