ctrl-alt-2 as at (@)

wettstae at gmail.com wettstae at gmail.com
Sat Jun 6 07:32:42 PDT 2015


Hello Knut,

Apparently, your keyboard attempts to make its special keys usable
without special drivers.  Many layouts have @ on the AltGr-layer of the
2 key.  So, to implement a @ key with such a layout, the keyboard
firmware could emulate pressing AltGr+2 simultaneously.  Moreover, on
Windows, pressing Ctrl+Alt is equivalent to pressing AltGr key.  So, on
Windows, emulating pressing Control+Alt+2 would work as well.  Your
keyboard manufacturer has chosen this second, Windows-specific
non-portable possibility.

You can work around this.  First, dump your current layout:

  xkbcomp -xkb :0 mylayout.xkb

Then you edit this file.  You look for key <AE02> and change the section
there to read like follows (I assume that you use a Danish layout):

    key <AE02> {
        type= "CTRL+ALT",
        symbols[Group1]= [               2,        quotedbl,              at,     twosuperior, at ]
    };

Then you send the modified layout back to the server:

  xkbcomp mylayout.xkb :0

Depending on the software you are using, this might or might not be
sufficient.  If you want to use Control+2, or if you use software which
implements keyboard handling sloppily, some more changes might be
required to workaround those quirks.  Let us know.

Andreas


More information about the xorg mailing list