Config XKB to map a key combination to another

Ken Moffat zarniwhoop at ntlworld.com
Mon Jun 4 15:45:52 UTC 2018


On Mon, Jun 04, 2018 at 04:39:58AM +0400, Sassan Haradji wrote:
> Hi,
> 
> 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?
> 
> Currently I'm using `autokey` to achieve this. But it's not stable at all.
> Using xkb to map my left ctrl to hyper and my caps lock to left ctrl worked
> perfect so I'm trying to migrate all mappings to xkb too.
> 
> Regards,
> Sassan

I'd never heard of a Hyper Key until I read your mail, nor autokey,
but for your purposes a few Compose entries are probably enough to
achieve this.  I put some notes up at
http://www.linuxfromscratch.org/~ken/xorg-keyboards/ 4 or 5 years
ago: the README file explains what this is all about - more
diacriticals (accents) and being able to type cyrillic or greek
(slowly!) цыриллиц and γρεεκ (the english letters typed on my
cyrillic map and then using Alt-G for dead greek).

Anyway, my XCompose has a LOT of entries - many of which I can never
remember - but mopst of them work.  You will only need a handful of
entries to do your mappings.

I also have an xkeyboard-config patch (the -apply- patch is to
upgrade an already installed system).  This is to map things the way
I like them (cyrillic letters as a second map, and both with more
dead keys to access accents, for example șàơƀ ҋҟ ) - going to the
trouble of making a new keymap is almost certainly only worthwhile
for people interested in other languages, or who have a completely
different organization of the letters (dvorak etc).

The patch I uploaded is old, but it still applies to current 2.23.1.

NB changing the keymap didn't work with systemd.  Fortunately, I
don't use that.

ĸen
-- 
              Keyboard not found, Press F1 to continue


More information about the xorg mailing list