Keyboard layout reset after attaching USB keyboard

Bug #295990 reported by Mikael Magnusson
88
This bug affects 10 people
Affects Status Importance Assigned to Milestone
xserver-xorg-input-evdev
Fix Released
Undecided
Unassigned
gnome-control-center (Ubuntu)
Invalid
Low
Ubuntu Desktop Bugs
xkeyboard-config (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: gnome-control-center

I use a laptop with Ubuntu 8.10, and has configured two keyboard layouts. I use "USA" as the default layout and "Sweden" as an alternative layout, and use <CapsLock> for changing layout.

1)
Description: Ubuntu 8.10
Release: 8.10

2)
gnome-control-center:
  Installed: 1:2.24.0.1-0ubuntu7.1
  Candidate: 1:2.24.0.1-0ubuntu7.1
  Version table:
 *** 1:2.24.0.1-0ubuntu7.1 0
        500 http://se.archive.ubuntu.com intrepid-updates/main Packages
        100 /var/lib/dpkg/status
     1:2.24.0.1-0ubuntu7 0
        500 http://se.archive.ubuntu.com intrepid/main Packages

3)
When I plug in an USB keyboard it should still be possible to change between the default and alternative layout with <CapsLock> or using the applet menu. The default and any alternative layout should user configurable, i.e. it should not restore system default values when an USB keyboard is attached.

4)
When I plug in an USB keyboard after logging in to Ubuntu, it resets the keyboard layout (and probably other keyboard settings as well) to the system default layout which is stored in /etc/default/console-setup.

Tags: hardy intrepid
Revision history for this message
Mikael Magnusson (mikma) wrote :
Revision history for this message
Mikael Magnusson (mikma) wrote :

gnome-control-center only store the default layout and not the alternative layout in /etc/default/console-setup when applying keyboard changes system wide.

Revision history for this message
William Grant (wgrant) wrote :

Is it fixed if you toggle the layout again?

Revision history for this message
Mikael Magnusson (mikma) wrote :

No, my swedish layout disappears from xkb after plugging in an USB keyboard. Refer to the setxkbmap output below.

Wanted configuration:
$ setxkbmap -print
xkb_keymap {
 xkb_keycodes { include "evdev+aliases(qwerty)" };
 xkb_types { include "complete" };
 xkb_compat { include "complete+ledcaps(group_lock)" };
 xkb_symbols { include "pc+us+se:2+inet(evdev)+group(caps_toggle)" };
 xkb_geometry { include "pc(pc105)" };
};

After plugging in an USB keyboard:
$ setxkbmap -print
xkb_keymap {
 xkb_keycodes { include "evdev+aliases(qwerty)" };
 xkb_types { include "complete" };
 xkb_compat { include "complete+ledcaps(group_lock)" };
 xkb_symbols { include "pc+us+inet(evdev)+group(caps_toggle)" };
 xkb_geometry { include "pc(pc105)" };
};

"se:2" is missing above.

And then changing any of the Keyboard Layout Options
$ setxkbmap -print
xkb_keymap {
 xkb_keycodes { include "evdev+aliases(qwerty)" };
 xkb_types { include "complete" };
 xkb_compat { include "complete+ledcaps(group_lock)" };
 xkb_symbols { include "pc+us+se:2+inet(evdev)+group(caps_toggle)" };
 xkb_geometry { include "pc(pc105)" };
};

"se:2" is there again.

Revision history for this message
Sebastien Bacher (seb128) wrote :

that's not a gnome-control-center bug

Changed in gnome-control-center:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Invalid
Revision history for this message
Taras (taras-siversky) wrote :

I confirm the very same bug. It always happens when I plug-out/plug-in a USB keyboard, and sometimes it happens without any obvious reason.

Revision history for this message
Anders Olsson (anders-anderso) wrote :

My problem is possibly related. After upgrading to Intrepid, the layout on the laptop keyboard and the usb keyboard is no longer Swedish (it's probably English). If I unplug and then plug in the usb keyboard - then the layout is Swedish on that keyboard but still English on the laptop. In control center the default layout is Swedish.

Revision history for this message
Bryce Harrington (bryce) wrote :

[This is an automated message]

Hi mikma,

Please attach the output of `lspci -vvnn` too.

Changed in xorg-server:
status: New → Incomplete
Revision history for this message
Mikael Magnusson (mikma) wrote :
Revision history for this message
positivek (anonyhole) wrote :

Hello,

I experience this bug. After plugging in the extern USB keyboard into my laptop, the external keyboard uses the qwerty (non-default for me) layout. But, the laptop's own (ps/2?) keyboard remains with the original keyboard layout that I had as my default at the time I plugged the external keyboard in.

I use the 'Keyboard Indicator 2.24.1' applet for switching between two layouts. Note that after plugging in the external usb keyboard, the Keyboard Indicator applet: is no longer able to switch between different layouts; and it indicates with it's mouse-hover popup info that I am now using the qwerty layout. However, my internal laptop is still using my original (Dvorak). Neither the internal or external keyboard can have their layouts changed/alternated using the applet the way I could before plugging in the external.

Gnome Version: 2.24.1
Distro: Ubuntu 8.10 (via upgrade)
Attached is the same 'lspci -vvnn' output.

Note that restarting X by logging out or Ctrl+Alt+Backspace will put everything back in order again, provided I do not plug keyboard in *after* my X Gnome session has started.

Please let me know how I can help with any more debugging information, outputs, etc.

Revision history for this message
Anders Olsson (anders-anderso) wrote :

That sound's related to my problem that I described above. I remember messing around with keyboard settings in gconf-editor, and I think it was something I changed in kbd.sysbackup that made a difference, just use the search function in gconf-editor to find it. Now everything works for me, external and internal keyboard. Maybe you can try it and post your results.

Bryce Harrington (bryce)
Changed in xorg-server:
status: Incomplete → New
Revision history for this message
Bryce Harrington (bryce) wrote :

Can you please re-test this against Jaunty? There have been several fixes upstream to layout issues which may already cover this case. It should be sufficient to test in a LiveCD environment if you do not wish to upgrade at this time; ISO images are available at http://cdimages.ubuntu.com/releases/jaunty. Thanks ahead of time!

Changed in xkeyboard-config:
status: New → Incomplete
Revision history for this message
Bryce Harrington (bryce) wrote :

We're closing this bug since it is has been some time with no response from the original reporter. However, if the issue still exists please feel free to reopen with the requested information. Also, if you could, please test against the latest development version of Ubuntu, since this confirms the bug is one we may be able to pass upstream for help.

Changed in xkeyboard-config:
status: Incomplete → Invalid
Revision history for this message
Chris (cmavr8) wrote :

Had same problem.
Tested it on Jaunty Alpha 5 Live cd and can't reproduce.

I assume it's fixed!

Revision history for this message
Chris (cmavr8) wrote :

Broken in latest Development updates!
Fixed in Alpha5, Broken in Beta?

Please mark as important. It is VERY annoying for laptop users. (docking/undocking or sleep/resume causes the bug)
It should be easily fixable.

Revision history for this message
Michal Krause (michal-launchpad) wrote :

The bug is still here in Xubuntu Jaunty Beta. As workaround, I use following script which runs automatically when USB keyboard is connected (can be configured in Menu -> Settings -> Remove Drives and Media -> Input Devices -> Keyboards in Xubuntu):

#!/bin/bash

setxkbmap -option grp:alt_shift_toggle,grp:switch,grp_led:scroll 'us,cz(qwerty)'

This script can be used to run xmodmap after connecting keyboard too:

xmodmap ~/.Xmodmap

Bryce Harrington (bryce)
Changed in xkeyboard-config (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Nikolaus Rath (nikratio) wrote :

JFTR: It seems to me that this bug is related to bug #287215. It's not a duplicate though, one deals with XKB and the other with xmodmap. But maybe a similar fix can be used in both cases.

Maybe this bug should also be assigned to xserver-xorg-input-evdev?

Revision history for this message
positivek (anonyhole) wrote :

As I believed to experience this bug ( comment #10 ), it is now working for me with these updates (through Update Manager). There was a link to Bug #363169 in the update notification, so maybe these are dupes? BTW, that bug is in libxklavier, and has duplicate bugs filed against xserver-xorg-input-evdev as comment #17 suggested.

That is, after these updates, I can now unplug and replug an external keyboard and retain my Dvorak layout settings.

Commit Log for Wed Jul 29 11:55:56 2009
Upgraded the following packages:
bind9-host (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
dnsutils (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
libbind9-40 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
libdns45 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
libisc45 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
libisccc40 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
libisccfg40 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
liblwres40 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
libpam-smbpass (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
libsmbclient (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
libwbclient0 (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
libxklavier12 (3.9-0ubuntu1) to 3.9-0ubuntu2
linux-generic (2.6.28.13.17) to 2.6.28.14.19
linux-headers-generic (2.6.28.13.17) to 2.6.28.14.19
linux-image-generic (2.6.28.13.17) to 2.6.28.14.19
linux-libc-dev (2.6.28-13.45) to 2.6.28-14.47
linux-restricted-modules-common (2.6.28-13.17) to 2.6.28-14.19
linux-restricted-modules-generic (2.6.28.13.17) to 2.6.28.14.19
samba (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
samba-common (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
smbclient (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
smbfs (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
winbind (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
xfce4-weather-plugin (0.6.2-1ubuntu2) to 0.6.2-1ubuntu2.9.04.1

Installed the following packages:
linux-headers-2.6.28-14 (2.6.28-14.47)
linux-headers-2.6.28-14-generic (2.6.28-14.47)
linux-image-2.6.28-14-generic (2.6.28-14.47)
linux-restricted-modules-2.6.28-14-generic (2.6.28-14.19)

Revision history for this message
Guraknugen (guraknugen) wrote : Re: [Bug 295990] Re: Keyboard layout reset after attaching USB keyboard

2009/7/30 positivek <email address hidden>

> As I believed to experience this bug ( comment #10 ), it is now working
> for me with these updates (through Update Manager). There was a link to
> Bug #363169 in the update notification, so maybe these are dupes? BTW,
> that bug is in libxklavier, and has duplicate bugs filed against
> xserver-xorg-input-evdev as comment #17 suggested.
>
> That is, after these updates, I can now unplug and replug an external
> keyboard and retain my Dvorak layout settings.

That sounds really great. I still use my workaround thing so I didn't notice
that anything happened, since I made my own layout to be the system
standard, so instead of switching from my own layout to the standard Swedish
layout, it switch from my own layout to my own layout, so I will never
notice any difference…
One thing that I have noticed, by the way, is that sometimes when I unplug
the receiver and replug it, the whole system crash…
I am still on Ubuntu 8.10, so I am not sure I have the same updates as you
guys with the newest version.
Johnny Rosenberg

>
>
> Commit Log for Wed Jul 29 11:55:56 2009
> Upgraded the following packages:
> bind9-host (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
> dnsutils (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
> libbind9-40 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
> libdns45 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
> libisc45 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
> libisccc40 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
> libisccfg40 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
> liblwres40 (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
> libpam-smbpass (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
> libsmbclient (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
> libwbclient0 (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
> libxklavier12 (3.9-0ubuntu1) to 3.9-0ubuntu2
> linux-generic (2.6.28.13.17) to 2.6.28.14.19
> linux-headers-generic (2.6.28.13.17) to 2.6.28.14.19
> linux-image-generic (2.6.28.13.17) to 2.6.28.14.19
> linux-libc-dev (2.6.28-13.45) to 2.6.28-14.47
> linux-restricted-modules-common (2.6.28-13.17) to 2.6.28-14.19
> linux-restricted-modules-generic (2.6.28.13.17) to 2.6.28.14.19
> samba (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
> samba-common (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
> smbclient (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
> smbfs (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
> winbind (2:3.3.2-1ubuntu3) to 2:3.3.2-1ubuntu3.1
> xfce4-weather-plugin (0.6.2-1ubuntu2) to 0.6.2-1ubuntu2.9.04.1
>
> Installed the following packages:
> linux-headers-2.6.28-14 (2.6.28-14.47)
> linux-headers-2.6.28-14-generic (2.6.28-14.47)
> linux-image-2.6.28-14-generic (2.6.28-14.47)
> linux-restricted-modules-2.6.28-14-generic (2.6.28-14.19)
>
> --
> Keyboard layout reset after attaching USB keyboard
> https://bugs.launchpad.net/bugs/295990
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>

--
Vänliga hälsningar

Johnny Rosenberg

Revision history for this message
michaelhhh (michael-hoennig) wrote :

My problem was actually a little bit different: the keyboard layout was lost at an unknown during work at the computer. I have not had the problem for a few days now either, BUT: I just tried this unlugging/plugging my USB keyboard. First it did work correctly after replugging, but just a minute later it did not work properly anymore, as it was interpreted as an US keyboard, where it is a German keyboard. And that after working fine for 2 days. Maybe there is a background process which brought up this result with this 1 min delay? Anyway, maybe there is a connection between the two problems after all.

Bryce Harrington (bryce)
tags: added: intrepid
Bryce Harrington (bryce)
tags: added: hardy
Revision history for this message
michaelhhh (michael-hoennig) wrote :

The behaviour which I mentioned did not reoccur since I upgraded to 10.04. But it's only one day so far with just a few hours acutually working. But maybe we are all lucky.

Revision history for this message
Simos Xenitellis  (simosx) wrote :

There have been significant changes in the handling of input devices which means that it is highly possible this bug has been fixed.
I am marking as solved; michaelhhh, if the problem persists please reopen.

Changed in evdev:
status: New → Fix Released
Changed in xkeyboard-config (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Frederik Eaton (frederik-launchpad) wrote :

I experience this bug on Raspbian, but not Arch. I don't have an Ubuntu system, but here is an easy way to reproduce it in software, which may be helpful:

    $ setxkbmap us basic
    $ setxkbmap us dvorak
    $ sudo udevadm trigger
    $ aoeuaoeusdfasdfasdf

You can see that half-way through typing the last line, the layout changes.

Revision history for this message
scheleaap (scheleaap) wrote :

I have started to experience this bug after upgrading from Ubuntu 18.04 to 20.04. Whenever I remove my external keyboard and plug it back in, the external keyboard's layout switches to US English instead of whatever it was set to. The laptop's built-in keyboard layout remains correct.

I did not notice any warnings in my logs. If you need more information / debug output, I'd be glad to help.

Some details:
* Laptop: Lenovo T480
* OS: Ubuntu 20.04
* External keyboard: Das Keyboard 4 Professional (model no.: DASK4MKPROSIL-3G7-r1.2)

Revision history for this message
scheleaap (scheleaap) wrote :

Update: The problem does not occur when I use Wayland instead of X.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

@scheleaap: Please don't talk on a 12 years old and closed bug report. You are probably experiencing bug #1899206.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.