Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

71%
+3 −0
Q&A Set compose key to Shift + AltGr

You can find a list of options in man xkeyboard-config. Under the section "key to choose the 3rd level" is the one you are after: lv3:ralt_switch_multikey Right Alt; Shift+Right Alt as Compo...

posted 2y ago by Quasímodo‭  ·  edited 2y ago by Quasímodo‭

Answer
#2: Post edited by user avatar Quasímodo‭ · 2022-09-24T15:28:19Z (about 2 years ago)
Fix copy-paste leftover
  • You can find a list of options in `man xkeyboard-config`.
  • Under the section "key to choose the 3rd level" is the one you are after:
  • lv3:ralt_switch_multikey Right Alt; Shift+Right Alt as Compose
  • To enable it, use
  • setxkbmap -option lv3:ralt_switch_multikey
  • You should also pass other options you already use to `-layout` or they will be reverted.
  • To make it permanent, add it to the comma separated XKBOPTIONS variable
  • in `/etc/default/keyboard`, e.g.:
  • XKBMODEL="pc105"
  • XKBLAYOUT="en"
  • XKBVARIANT=""
  • XKBOPTIONS="lv3:ralt_switch_multikey"
  • BACKSPACE="guess"
  • -----
  • That option is defined in /usr/share/X11/xkb/symbols/level3 as
  • // The right Alt key (while pressed) chooses the third shift level,
  • // and Compose is mapped to its second level.
  • partial modifier_keys
  • xkb_symbols "ralt_switch_multikey" {
  • key <RALT> {
  • type[Group1]="TWO_LEVEL",
  • symbols[Group1] = [ ISO_Level3_Shift, Multi_key ]
  • };
  • include "level3(modifier_mapping)"
  • };
  • In general, if the desired combination weren't available, you could create
  • your own map. E.g., to make the menu key* have that behavior,
  • ==> ~/.config/xkb/symbols/mymap <==
  • partial alphanumeric_keys modifier_keys
  • xkb_symbols "acer" {
  • key <MENU> {
  • type="TWO_LEVEL",
  • symbols[Group1] = [ ISO_Level3_Shift, Multi_key ]
  • };
  • };
  • Then create this one from `setxkbmap -print` and append your custom option
  • to `xkb_symbols`:
  • ==> ~/.config/xkb/main <==
  • xkb_keymap {
  • xkb_keycodes{include "evdev+aliases(qwerty)"};
  • xkb_types {include "complete"};
  • xkb_compat {include "complete"};
  • xkb_symbols {include "pc+en+inet(evdev)+mymap(mymap)"};
  • xkb_geometry{include "pc(pc105)"};
  • };
  • Finally, run
  • xkbcomp -I"$HOME/.config/xkb" "$HOME/.config/xkb/main" "$DISPLAY"
  • at every X session start to put load that custom key map.
  • *`xkbcomp "$DISPLAY" -` outputs your full key map; useful to find a key name.
  • You can find a list of options in `man xkeyboard-config`.
  • Under the section "key to choose the 3rd level" is the one you are after:
  • lv3:ralt_switch_multikey Right Alt; Shift+Right Alt as Compose
  • To enable it, use
  • setxkbmap -option lv3:ralt_switch_multikey
  • You should also pass other options you already use to `-layout` or they will be reverted.
  • To make it permanent, add it to the comma separated XKBOPTIONS variable
  • in `/etc/default/keyboard`, e.g.:
  • XKBMODEL="pc105"
  • XKBLAYOUT="en"
  • XKBVARIANT=""
  • XKBOPTIONS="lv3:ralt_switch_multikey"
  • BACKSPACE="guess"
  • -----
  • That option is defined in /usr/share/X11/xkb/symbols/level3 as
  • // The right Alt key (while pressed) chooses the third shift level,
  • // and Compose is mapped to its second level.
  • partial modifier_keys
  • xkb_symbols "ralt_switch_multikey" {
  • key <RALT> {
  • type[Group1]="TWO_LEVEL",
  • symbols[Group1] = [ ISO_Level3_Shift, Multi_key ]
  • };
  • include "level3(modifier_mapping)"
  • };
  • In general, if the desired combination weren't available, you could create
  • your own map. E.g., to make the menu key* have that behavior,
  • ==> ~/.config/xkb/symbols/mymap <==
  • partial alphanumeric_keys modifier_keys
  • xkb_symbols "mymap" {
  • key <MENU> {
  • type="TWO_LEVEL",
  • symbols[Group1] = [ ISO_Level3_Shift, Multi_key ]
  • };
  • };
  • Then create this one from `setxkbmap -print` and append your custom option
  • to `xkb_symbols`:
  • ==> ~/.config/xkb/main <==
  • xkb_keymap {
  • xkb_keycodes{include "evdev+aliases(qwerty)"};
  • xkb_types {include "complete"};
  • xkb_compat {include "complete"};
  • xkb_symbols {include "pc+en+inet(evdev)+mymap(mymap)"};
  • xkb_geometry{include "pc(pc105)"};
  • };
  • Finally, run
  • xkbcomp -I"$HOME/.config/xkb" "$HOME/.config/xkb/main" "$DISPLAY"
  • at every X session start to put load that custom key map.
  • *`xkbcomp "$DISPLAY" -` outputs your full key map; useful to find a key name.
#1: Initial revision by user avatar Quasímodo‭ · 2022-09-24T15:23:42Z (about 2 years ago)
You can find a list of options in `man xkeyboard-config`.

Under the section "key to choose the 3rd level" is the one you are after:

    lv3:ralt_switch_multikey      Right Alt; Shift+Right Alt as Compose

To enable it, use

    setxkbmap -option lv3:ralt_switch_multikey

You should also pass other options you already use to `-layout` or they will be reverted.

To make it permanent, add it to the comma separated XKBOPTIONS variable
in `/etc/default/keyboard`, e.g.:

    XKBMODEL="pc105"
    XKBLAYOUT="en"
    XKBVARIANT=""
    XKBOPTIONS="lv3:ralt_switch_multikey"
    BACKSPACE="guess"

-----

That option is defined in /usr/share/X11/xkb/symbols/level3 as

    // The right Alt key (while pressed) chooses the third shift level,
    // and Compose is mapped to its second level.
    partial modifier_keys
    xkb_symbols "ralt_switch_multikey" {
      key <RALT> {
        type[Group1]="TWO_LEVEL",
        symbols[Group1] = [ ISO_Level3_Shift, Multi_key ]
      };
      include "level3(modifier_mapping)"
    };

In general, if the desired combination weren't available, you could create
your own map. E.g., to make the menu key* have that behavior,

    ==> ~/.config/xkb/symbols/mymap <==

    partial alphanumeric_keys modifier_keys
    xkb_symbols "acer" {
        key <MENU> {
            type="TWO_LEVEL",
            symbols[Group1] = [ ISO_Level3_Shift, Multi_key ]
        };
    };

Then create this one from `setxkbmap -print` and append your custom option
to `xkb_symbols`:

    ==> ~/.config/xkb/main <==

    xkb_keymap {
        xkb_keycodes{include "evdev+aliases(qwerty)"};
        xkb_types   {include "complete"};
        xkb_compat  {include "complete"};
        xkb_symbols {include "pc+en+inet(evdev)+mymap(mymap)"};
        xkb_geometry{include "pc(pc105)"};
    };

Finally, run

    xkbcomp -I"$HOME/.config/xkb" "$HOME/.config/xkb/main" "$DISPLAY"

at every X session start to put load that custom key map.

*`xkbcomp "$DISPLAY" -` outputs your full key map; useful to find a key name.