LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Fedora 22 gnome Strg + Alt act like AltGr (https://www.linuxquestions.org/questions/linux-newbie-8/fedora-22-gnome-strg-alt-act-like-altgr-4175556714/)

thanquol1313 10-20-2015 03:09 PM

Fedora 22 gnome Strg + Alt act like AltGr
 
I'm using the German keyboard layout but I'm used to the Windows behaviour that Strg + Alt acts like the AltGr key. I need it for programming to reach leftbracket etc. easily. I've tried already some stuff and read through man pages and online tuts but nothing works the way I want so far. My most recent attempt was editing the xkb files to add a new variant based on the original german layout.

Code:

$ sudo gedit /usr/share/X11/xkb/symbols/de
...
partial alphanumeric_keys modifier_keys
xkb_symbols "win" {
    // previous standard German layout but CTRL + ALT is level3
       
    include "de(basic)"
    name[Group1]="German (win)";
       
    key <AE07>  {type[Group2]="CTRL_ALT", symbols[Group1]=[7, slash], symbols[Group2]=[braceleft, seveneight]};
       
    include "kpdl(dot)"
};
...

For testing purposes I added only <AE07> but in the end it shall work with <AE08> ... too
The selection of the variant works so far that on the NUMPAD , is now a . (so include "kpdl(dot)" works)

Code:

$ sudo gedit /usr/share/X11/xkb/types/level3

partial default xkb_types "default" {

    // A key type which can be used to implement
    // a windows behaviour to reach level3

    virtual_modifiers Alt;

    type "CTRL_ALT" {
        modifiers = Shift+Ctrl;
        map[None] = Level1;
        map[Shift] = Level2;
        map[Alt+Ctrl] = Level3;
        map[Shift+Alt+Ctrl] = Level4;
        level_name[Level1] = "Base";
        level_name[Level2] = "Shift";
        level_name[Level3] = "Level3";
        level_name[Level4] = "Level4";
    };
};

New entries in evdev.lst and xorg.lst to make the variant available in Settings > Keyboard > Input Sources
Code:

...
  os              ge: Ossetian (Georgia)
  win                  de: German (win)
  deadacute      de: German (dead acute)
...

New entries in evdev.xml and xorg.xml
Code:

...     
<layout>
      <configItem>
        <name>de</name>
       
        <shortDescription>de</shortDescription>
        <description>German</description>
        <languageList>
          <iso639Id>ger</iso639Id>
        </languageList>
      </configItem>
      <variantList>
        <variant>
          <configItem>
            <name>win</name>
            <description>German (win)</description>
          </configItem>
        </variant>

        <variant>
          <configItem>
            <name>deadacute</name>
            <description>German (dead acute)</description>
          </configItem>
        </variant>
...

What am I missing? Please help.

Emerson 10-22-2015 06:54 AM

I was in the same boat when I wanted to add support for my native language to the US keyboard.
After messing with system files I figured it is best done in the user level. System files may be overwritten by an upgrade, too.
I created ~/.xmodmaprc file with my modifications. Depending on your distro this file may be called ~/.Xmodmap.
Of course, you can open a terminal and execute xmodmap ~/.xmodmaprc any time and your changes take effect immediately.


All times are GMT -5. The time now is 05:39 AM.