Keyboard layout not detected. #202

Open
bootkiller opened this Issue Jun 24, 2014 · 28 comments

Comments

Projects
None yet

SDDM isn't picking up the keyboard layout.

Output of /etc/vconsole.conf:

KEYMAP=pt-latin9
FONT=Lat2Terminus16

Output of Systemd's localectl

System Locale: LANG=en_GB.UTF-8
   VC Keymap: pt-latin9
   X11 Layout: pt
   X11 Model: dell101
   X11 Variant: latin9
Owner

plfiorini commented Jun 24, 2014

Off the top of my head, sddm uses xcb API to list the keymaps.
We should use some systemd API when building for systems powered by systemd.

When you set x11 layout with localectl, it creates the the file /etc/X11/xorg.conf.d/00-keyboard.conf:

# Read and parsed by systemd-localed. It's probably wise not to edit this file
# manually too freely.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "pt"
        Option "XkbModel" "dell101"
        Option "XkbVariant" "latin9"

I'm just an user not a dev, so I'm not sure where from xcb is getting the keymap from.

Contributor

dbluelle commented Aug 16, 2014

I have the same problem, but on my machine the layout list is filled after I enter one character in
the password field

Contributor

majewsky commented Nov 16, 2014

Having the same problem with the Arch package of sddm. The keyboard layout dropdown shows "English (US)" only, whereas I would need a German layout.

$ pacman -Q sddm
sddm-0.10.0-3

$ cat /etc/locale.conf
LANG=de_DE.UTF-8
LC_MESSAGES=C

$ cat /etc/vconsole.conf
KEYMAP=de-latin1-nodeadkeys
FONT=latarcyrheb-sun16

$ localectl
   System Locale: LANG=de_DE.UTF_8
                  LC_MESSAGES=C
       VC Keymap: de-latin1-nodeadkeys
      X11 Layout: n/a

I remember having had the same problem with KDM before, but it wasn't much of a big deal because I had autologin + auto-session-locking configured (which SDDM cannot do currently, see #306).

@majewsky You should try setting the x11 keymap through localectl. I just did that, and even though SDDM still indicates English (US) layout, when I type my password it is actually using the correct layout (dk).

I used localectl like this:

$ localectl set-x11-keymap layout us colemak

and now localectl shows me this:

$ localectl
  System Locale: LANG=fi_FI.UTF-8
      VC Keymap: n/a
     X11 Layout: layout
      X11 Model: us
    X11 Variant: colemak

At least it seems to detect it's us-layout now but not that it's colemak variant.

@ghost

ghost commented Dec 31, 2014

I did a fresh install of Arch Linux today, encountered the same issue, fixed though (probably not the proper way, however if anyone is interested see below.)

[root@existence:kmikazuki]# pacman -Q sddm
sddm 0.11.0-1
[root@existence:kmikazuki]# cat /etc/locale.conf
LANG=en_US.UTF-8
[root@existence:kmikazuki]# cat /etc/vconsole.conf
KEYMAP=colemak
[root@existence:kmikazuki]# localectl
   System Locale: LANG=en_US.UTF-8
       VC Keymap: colemak
      X11 Layout: colemak
       X11 Model: colemak
     X11 Variant: colemak
[root@existence:kmikazuki]# cat /etc/X11/xorg.conf.d/
00-keyboard.conf  10-evdev.conf     
[root@existence:kmikazuki]# cat /etc/X11/xorg.conf.d/00-keyboard.conf 
# Read and parsed by systemd-localed. It's probably wise not to edit this file
# manually too freely.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "colemak"
        Option "XkbModel" "colemak"
        Option "XkbVariant" "colemak"
EndSection
[root@existence:kmikazuki]# cat /etc/X11/xorg.conf.d/10-evdev.conf 
Section "InputClass"
        Identifier "evdev keyboard catchcall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
        # Set keyboard to colmak. 
        Option "XkbLayout" "us"
        Option "XkbVariant" "colemak"
EndSection

Again I went against the advice of the file note to not edit them, however end results achieves what I wanted, and I have yet to encounter any issues. Note after making changes, you will need to reboot your computer. There is probably a proper way to do this however I do not know how.

Peace.

fgatbdx commented Jan 9, 2015

I have the same behavior with 2 new installation of Fedora 21, KDE spin. I did installation on 2 different PCs. Both installation were done in french.

  • On 1st PC the SDDM login window shows a US flag for the language, but as soon as I enter the password, the flag turns to French. Strange behavior but it works as mention by tachylatus.
  • The behavior is different on the second PC: at sddm login window, it is and remains US keyboard. The password is the same between PCs (same user too).

On both PCs

LANG="fr_FR.UTF-8"
KEYMAP="fr-oss"
option "XkbLayout" "fr"
option "XkbVariant" "oss"

Boring bug if we want to use a safe password, with non std char.

@jleclanche jleclanche added this to the 1.0.0 milestone Feb 20, 2015

rjurga commented Feb 25, 2015

Same thing on Arch Linux. Used localectl to configure the keymap for both the VC and X11. On the login screen, the language flag is set to US until I type the first character of the password and it switches to the right language by itself. Before typing the first character, while it still shows the US flag, the right language doesn't appear in the drop down menu, only US is present.

Exact same behaviour as what @polomi described above, on Mageia 5. FYI, here is the corresponding Mageia bug report: https://bugs.mageia.org/show_bug.cgi?id=15357

Edit

/usr/share/sddm/scripts/Xsetup

and append

setxkbmap XX

where XX is the preferred layout.

EvilMav commented Mar 10, 2015

@miguelpenc Thank you! That did the trick.

@plfiorini plfiorini modified the milestones: post-0.12, 0.12 Aug 20, 2015

Contributor

davispuh commented Aug 22, 2015

This is Xcb bug (even with latest libxcb from git master branch), because in XcbKeyboardBackend::initLayouts

        cookie = xcb_xkb_get_names(m_conn,
                XCB_XKB_ID_USE_CORE_KBD,
                XCB_XKB_NAME_DETAIL_GROUP_NAMES | XCB_XKB_NAME_DETAIL_SYMBOLS);
        reply = xcb_xkb_get_names_reply(m_conn, cookie, nullptr);

it always returns "us" layout on startup, but as soon as any key is pressed then XCB_XKB_NEW_KEYBOARD_NOTIFY event will be issued and then it will return correct layout.

Probably need to report it upstream to them as only workaround could be to somehow fake a key press...

A bonus would be, that the user somewhere can choose the layout at startup.
Usecase: Consider a multiuser system, where some user prefer normal qwerty and another something like dvorak. Then the user(s), whose keyboard layout is not the default in sddm, has to learn to type his password in two layouts.

Contributor

majewsky commented Sep 5, 2015

@Tratoschek That's a separate issue and you should open a separate issue for that to ensure that it's not missed.

done: #482

@jleclanche jleclanche added the systemd label Nov 5, 2015

@jleclanche jleclanche modified the milestones: 0.14, post-0.12 Nov 5, 2015

Alko89 commented Nov 18, 2015

I had the same issue and fixed it with localectl set-x11-keymap si asus_laptop. The keymap is now correct, but the dropdown still shows a US flag.

Hi there, any clue about this issue? It's mostly cosmetic but quite confusing for many users of non en_US locale to be greeted at every boot by an icon saying they are configured for en_US keyboard, while starting typing will switch to the actual configured locale.

If it is just about cosmetics, then the easiest thing to do is either using a theme that doesn't show the language button, or modify one of your preference to the same purpose.

Dropping a feature completely for the sake of cosmetics doesn't feel right... And I'm looking here for a change that will be applied at the distro packaging level, if all distros start hacking the upstream theme to remove the keyboard choosing feature, it doesn't feel right either... :)

@davispuh By any chance, did you already report it upstream to libxcb?

Contributor

davispuh commented Jan 13, 2016

No, I haven't had time to investigate this more.

Taken the freedom to report it, let's see what comes out ...
https://bugs.freedesktop.org/show_bug.cgi?id=93701

@plfiorini Can you provide some help on how to run a binary and redirect it's output to some logfile
( code attached to https://bugs.freedesktop.org/show_bug.cgi?id=93701#c1 )
when sddm starts but before the first keyboard keypress? Would /usr/share/sddm/scripts/Xsetup work for that?

@doktor5000 To my knowledge /usr/share/sddm/scripts/Xsetup works like that. to redirect output of a binary file use:
~% ./name_of_the_program &> /path/to/logfile/logfiele.log

@miguelpenc Well aware how to do shell redirection, I was just asking if this needs to be done from sddm-greeter, maybe my question wasn't phrased that well :)

Anyways, as sddm waits for /usr/share/sddm/scripts/Xsetup to exit before starting, didn't achieve exactly what I wanted, but it works. When Xsetup runs so before any key has been pressed, it returns English (US) and after a keypress or in the normal session it returns German (eliminate dead keys) as expected.

@plfiorini plfiorini modified the milestones: 0.15, 0.14 Apr 5, 2016

@plfiorini plfiorini modified the milestones: 0.16, 0.15 Aug 23, 2016

rapgro commented Nov 8, 2016

Reproducible for me. Fedora 24 x86_64 with german locale.

I have the same problem I think.

Upon boot, SDDM is in QWERTY without a way to change that. It does not change to the correct layout (Colemak) when I start typing; I actually have to type my password in QWERTY to login.

localectl
   System Locale: LANG=nl_NL.UTF-8
       VC Keymap: colemak
      X11 Layout: colemak

I also have setxkbmap colemak in /usr/share/sddm/scripts/Xsetup but that does not seem to have any effect.

@plfiorini plfiorini removed this from the 0.16 milestone Nov 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment