vmod: bring back support for direct vmod -> real mod mapping
authorRan Benita <ran234@gmail.com>
Tue, 27 Nov 2012 08:42:15 +0000 (10:42 +0200)
committerRan Benita <ran234@gmail.com>
Wed, 12 Feb 2014 08:00:16 +0000 (10:00 +0200)
commit5bd273a724e034edc3a786abda8bd4debf3fbe48
tree996040e4ee674cee035eb8274cbad30b2e3a17cd
parentaed34694749a147f82d4d2cd990d086aa5d3bde6
vmod: bring back support for direct vmod -> real mod mapping

This brings back the functionality that was removed in
b9c87eb710ba4a86455601ca8c5a516b25e20366. Though it is not used in
xkeyboard-config, from our current perspective it can be quite useful to
be able to set the mappings directly, thus sidestepping the ugly and
legacy-ridden modifier_map statement.

Here's an example of how to get rid of modifier_map statements (though
that would break core-X11 applications, since they must have the
mappings through keysyms):
    virtual_modifiers NumLock = Mod2;
    virtual_modifiers Alt = Mod1;
    // Would be nice to map these to Alt, but that would be
    // incompatible with xkbcomp and somewhat complicated
    virtual_modifiers LAlt = Mod1;
    virtual_modifiers RAlt = Mod1;
    virtual_modifiers LevelThree = Mod5;
    virtual_modifiers RControl = Control;
    virtual_modifiers LControl = Control;
    virtual_modifiers Super = Mod4;
    virtual_modifiers Meta = Mod1;
    virtual_modifiers Hyper = Mod4;
    virtual_modifiers AltGr = Mod5;
    virtual_modifiers LShift = Shift;
    virtual_modifiers RShift = Shift;

Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/compat.c
src/xkbcomp/symbols.c
src/xkbcomp/types.c
src/xkbcomp/vmod.c
src/xkbcomp/vmod.h