Bug 19395

Summary: Core keyboard default rule error with evdev
Product: xorg Reporter: Yan Li <yan.i.li>
Component: Input/KeyboardAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: medium CC: peng.li
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Let-the-DDX-decide-on-the-XkbRulesDefaults none

Description Yan Li 2009-01-04 19:25:06 UTC
Overview: 
Core keyboard is initialized by using rule "base", model "pc105", layout "us", (dix/devices.h:529). This doesn't work with evdev. With evdev it should be "evdev", "evdev", "us".

On an Acer Aspire One running latest xorg-server (1.5.99.3) without a configure file. After startup the virtual core keyboard is using "xfree86" keycodes, while the AT keyboard is using "evdev" keycodes. This is wrong. Many control keys doesn't work out-of-the-box. Most annoying is that arrow keys doesn't work.

Worthnoting that this problem is concealed for a long time since if you are using a DM that set the keyboard layout on startup, like most GNOME/KDE. The DM would likely set all keyboards layout to the one it prefer thus overwrite the wrong default one for core keyboards.

I'm not using a heavy DM and was hit by this problem. I spend much time to study it and hope this is the root cause.

Steps to Reproduce: 
1. install latest xorg-server (1.5.99.3 here)
2. make sure you don't have a config file
3. start X, don't load a desktop manager since the DM will very likely set the layout by itself and conceal this problem
4. the arrow keys doens't work

run `xkbcomp :0.0 /tmp/xkb.out'. check the output and you'll see that xkb_keycodes is "xfree86+..." and this is wrong for an evdev keyboard.

Actual Results: 
Arrow keys don't work out-of-the-box.

Expected Results:
All keys should work correctly.

Build Date & Platform:
xorg-server 1.5.99.3
evdev 2.1.0
Comment 1 Yan Li 2009-01-04 21:00:36 UTC
I think commit 9c5dd7337fa93fb1650cc017e523b939dcbf482a "Let the DDX decide on the XkbRulesDefaults." should fix this problem. It's already in master, I'm trying it on 1.5.99.3.
Comment 2 Yan Li 2009-01-04 22:07:20 UTC
Created attachment 21666 [details] [review]
Let-the-DDX-decide-on-the-XkbRulesDefaults

Backported from commit 9c5dd7337fa93fb1650cc017e523b939dcbf482a
Comment 3 Yan Li 2009-01-04 22:08:36 UTC
I've attached the patch. It fixed the problem and worked well for me. Please consider including it into 1.6 branch.
Comment 4 Peter Hutterer 2009-01-04 22:24:58 UTC
This is fixed by 9c5dd7337fa93fb1650cc017e523b939dcbf482a.
http://cgit.freedesktop.org/xorg/xserver/commit/?id=9c5dd7337fa93fb1650cc017e523b939dcbf482a

Currently waiting for a cherry-pick to 1.6, please close this bug when it has
been pushed onto 1.6.
Comment 5 Peter Hutterer 2009-01-04 22:26:14 UTC
sorry, didn't see your comments until after I replied. Thanks for the
backport.
Comment 6 Peter Hutterer 2009-10-15 21:27:34 UTC
been in 1.6 since cc78f04b22daabc06d9fb82f550e3f4dbbe76f28. closing as fixed.

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.