AltGr doesn't work in Linux console

7,913

Solution 1

Solution for my problem is to run localectl --no-convert set-keymap cz.

This will change VC Keymap from cz-us-qwertz which doesn't seem to define AltGr combinations as they are shown here.

Solution 2

I had what looks like the same problem, after I switched to the Gnome desktop. But setting any of the de keymaps like in the first answer was no help. Apparently Gnome maps AltGr to Alt, and this can be changed with

gsettings set org.gnome.desktop.input-sources xkb-options "['mode_switch:ralt_rctrl']"
Share:
7,913

Related videos on Youtube

AmirMasoud Garavand
Author by

AmirMasoud Garavand

Updated on September 18, 2022

Comments

  • AmirMasoud Garavand
    AmirMasoud Garavand over 1 year

    When I am in a console (not terminal emulator) (after using Ctrl+Alt+F_, AltGr+key combinations are not working.

    I am using a Czech keyboard layout which (as many layouts do) maps various special characters to AltGr+key combinations (sometimes called dead keys, I believe). For example I can write | by typing AltGr+w (AltGr is right-Alt).

    This works perfectly in DE (in my case GNOME Shell), but doesn't in a Linux console. Any advice how to fix it? The Czech layout is missing many important keys (like >) so it's kinda impossible to work in terminal. I use Fedora 25 with latest updates.

    EDIT: I've just tried it on my second PC with Fedora 25 (but upgraded from F24 and still using X11 instead of Wayland) and it works correctly..

    Output of dumpkeys | grep -e 'AltGr\|Alt':

    keycode  56 = Alt              Alt              Alt              Alt              Alt              Alt              Alt              Alt              Alt              Alt              Alt              Alt              Alt              Alt              Alt              Alt             
    keycode 100 = AltGr            AltGr            AltGr            AltGr            AltGr            AltGr            AltGr            AltGr            AltGr            AltGr            AltGr            AltGr            AltGr            AltGr            AltGr            AltGr           
    keycode 119 = AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock       AltGr_Lock    
    

    Output of dumpkeys | grep -ie 'AltGr' | sed -n '1,5p; 50,55p':

    altgr   alt keycode   2 = Meta_one        
    shift   altgr   alt keycode   2 = Meta_exclam     
    altgr   control keycode   4 = Escape          
    altgr   alt keycode   4 = Meta_three      
    shift   altgr   alt keycode   4 = Meta_three      
    shift   altgr   alt keycode  52 = Meta_greater    
    altgr   control keycode  53 = Delete          
    altgr   alt keycode  53 = Meta_slash      
    shift   altgr   alt keycode  53 = Meta_question   
    altgr   control keycode  59 = F1              
    altgr   alt keycode  59 = Console_1     
    

    Output of localectl status:

     System Locale: LANG=en_US.UTF-8
                  LC_NUMERIC=cs_CZ.UTF-8
                  LC_TIME=cs_CZ.UTF-8
                  LC_MONETARY=cs_CZ.UTF-8
                  LC_PAPER=cs_CZ.UTF-8
                  LC_MEASUREMENT=cs_CZ.UTF-8
       VC Keymap: cz-us-qwertz
      X11 Layout: cz,us
     X11 Variant: ,