Bug 26402 - Have to type on internal keyboard to get proper layout
Summary: Have to type on internal keyboard to get proper layout
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/Core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-02 15:48 UTC by Samuel Thibault
Modified: 2018-12-17 17:28 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
xev log (8.75 KB, text/plain)
2010-02-02 15:48 UTC, Samuel Thibault
no flags Details
xorg log (34.95 KB, text/plain)
2010-02-02 15:56 UTC, Samuel Thibault
no flags Details
working xev log (9.84 KB, text/plain)
2010-02-03 01:26 UTC, Samuel Thibault
no flags Details
working xorg log (32.34 KB, text/plain)
2010-02-03 01:27 UTC, Samuel Thibault
no flags Details
trigger program (290 bytes, text/plain)
2011-04-19 16:11 UTC, Samuel Thibault
no flags Details

Description Samuel Thibault 2010-02-02 15:48:56 UTC
Created attachment 33017 [details]
xev log

Hello,

I've recently upgraded my laptop to Xorg 7.5, and since then by default
the layout of my external USB keyboard is qwerty, and as soon as I type
something on the internal keyboard, the layout switches to the expected
azerty layout. I'm attaching an xev log: I've typed the external 'a'
key, then the internal 'a' key, then the external 'a' key again.

Samuel
Comment 1 Samuel Thibault 2010-02-02 15:56:28 UTC
Created attachment 33018 [details]
xorg log

Xorg log

event3 is the internal keyboard, event11 is the external USB keyboard

Bus 004 Device 004: ID 0458:004c KYE Systems Corp. (Mouse Systems) Slimstar Pro Keyboard
Comment 2 Peter Hutterer 2010-02-02 22:34:12 UTC
does this happen with a desktop environment or even on a play X server with just xterm running?
Comment 3 Samuel Thibault 2010-02-03 01:25:38 UTC
I'm using just fvwm and xterm. Interestingly, now that I am at work,
the layout is correctly azerty on the external (USB too) keyboard
without having to type on the internal keyboard.
Comment 4 Samuel Thibault 2010-02-03 01:26:34 UTC
Created attachment 33023 [details]
working xev log
Comment 5 Samuel Thibault 2010-02-03 01:27:03 UTC
Created attachment 33024 [details]
working xorg log
Comment 6 Samuel Thibault 2010-02-03 01:28:37 UTC
In the attached working logs, the external USB keyboard is now event9.
Comment 7 Peter Hutterer 2010-05-05 16:54:12 UTC
Sorry about the silence. Is this still an issue or is it resolved?

Any chance of fvwm overwriting the system-configured layout with a default "us" layout?
Comment 8 Samuel Thibault 2010-05-05 17:01:47 UTC
Still an issue. fvwm doesn't do anything about the keyboard layout.
Actually, just xinit /usr/bin/xterm (thus without fvmw) has the issue too.
Comment 9 Peter Hutterer 2010-05-05 18:02:00 UTC
the layout doesn't switch after the first keystroke, does it? so if you keep typing on the external one only, does it stay qwerty?
Comment 10 Samuel Thibault 2010-05-05 18:15:26 UTC
> the layout doesn't switch after the first keystroke, does it?

It switches after the first keystroke on the internal keyboard (whatever
the key, can be control for instance).

> so if you keep typing on the external one only, does it stay qwerty?

Yes.
Comment 11 Samuel Thibault 2011-04-19 16:11:42 UTC
Created attachment 45833 [details]
trigger program

Hello,

Due a completely unrelated bug (wrong keyboard layout in accessibility
layer), I have actually found a program which triggers the issue,
here it is: it simply uses the XTest extension to simulate a key
press. That alone triggers the issue I'm seeing: my external USB
keyboard turns to qwerty, and I have to type a key on my internal
keyboard to get everything back to azerty.

So, to recap:

- X server start
- the USB keyboard keymap is qwerty, even if the Xorg log file confirms

(**) Option "xkb_rules" "evdev" 
(**) Option "xkb_model" "geniuskb19e" 
(**) Option "xkb_layout" "fr" 
(**) Option "xkb_options" "compose:lwin,compose:rwin,nbsp:level3n,
grp:shift_caps_toggle,grp_led:scroll,terminate:ctrl_alt_bksp"

and setkxbmap -print shows

xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(azerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete+ledscroll(group_lock)" };
	xkb_symbols   { include "pc+fr+inet(evdev)+
	group(shift_caps_toggle)+compose(lwin)+compose(rwin)+
	nbsp(level3n)+terminate(ctrl_alt_bksp)"	};
	xkb_geometry  { include "pc(pc104)"	};
};

- pressing any key on the internal keyboard makes the keymap turn
azerty as appropriate (I can indeed see in xev a MappingNotify event).
- running the attached test program emits keycode 24, but that actually
gets translated into 'q' (I can indeed see in xev a MappingNotify event
just before the key event)
- pressing any key on the internal keyboard makes the keymap turn
correct again.

At any stage, running setxkbmap without any option also makes the
keymap turn correct, the output of setxkbmap -print is the same. But
then the attached test program doesn't turn the keymap back to qwerty
any more.

It seems the keymap parameters aren't completely properly recorded
somewhere until I run setxkbmap.
Comment 12 Samuel Thibault 2011-04-19 16:14:00 UTC
Also to be noted: my keyboard configuration is held in udev, not in xorg.conf (which doesn't even exist).
Comment 13 Peter Hutterer 2011-07-10 19:17:12 UTC
I've had a look at this and it's not easy to fix in the server. The XTest devices are built-in and don't go through the usual configuration process (i.e. they don't see the options applied to other devices). So they always come up with the default layout. Once a real keyboard is used, that keyboard's layout moves into the master keyboard and takes from there.

I'm not sure how to fix this at this point other than applying the keyboard layout from the client to the XTest device before sending events through it.

As for the external vs internal issue -no idea still.
Comment 14 reztho 2013-12-02 22:12:48 UTC
I'm having the same problem too. I have a laptop connected to a wireless logitech keyboard and this happens even without a DE, just with startx.

In my case, the spanish layout isn't applied.

Currently I'm using autologin with LightDM so I can just add a "setxkbmap es" to my .xprofile. But in the case I don't want to use autologin, this bug is a showstopper for me since I cannot input my password correctly using the wireless keyboard in LightDM because of the layout mess.

This bug is reported along a lot of other bugtrackers. For example, see the last post at the bottom of this page:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672231

Using Archlinux, xorg-server 1.14.4.
Comment 15 GitLab Migration User 2018-12-17 17:28:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/604.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.