Bug 25732 - XKeycodeToKeysym returns incorrect value
Summary: XKeycodeToKeysym returns incorrect value
Status: RESOLVED NOTABUG
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/XKB (show other bugs)
Version: unspecified
Hardware: x86 (IA32) other
: medium normal
Assignee: Daniel Stone
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-20 17:47 UTC by Rafal Radulski
Modified: 2009-12-27 10:04 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Ouput from xkbcomp :0 -xkb out.xkb (61.82 KB, text/plain)
2009-12-26 08:27 UTC, Rafal Radulski
no flags Details
Source code that recreates the bug. (440 bytes, text/plain)
2009-12-26 12:27 UTC, Rafal Radulski
no flags Details

Description Rafal Radulski 2009-12-20 17:47:38 UTC
I'm using Ubuntu 9.10 (upgraded from previous release). Using Ubuntu's menu System -> Preferences -> Keyboard, I selected Czechia layout. Then, when I run a program with a call to XKeycodeToKeysym(), I get incorrect return value.

I'm passing keycode 11. That is a key marked with "2" and "@". I'm getting the following returned: index 0 - keysym 492, 1 - 50, 2 - 50, 3 - 64. I'm expecting the following values: 0 - 492, 1 - 50, 2 - 64, 3 - ?. All numbers are in decimal.

I'm expecting at-sign (keysym=64) for index 2, and dead-caron for index 3.

When I type text with keyboard, everything works correctly. I can type "2" with shift, at-sign with right-alt, and dead-caron with both shift and right-alt.

Please, let me know if you need more information.
Rafal
Comment 1 Sergey V. Udaltsov 2009-12-24 15:14:26 UTC
Please attach the output of xkbcomp :0 -xkb out.xkb
Comment 2 Rafal Radulski 2009-12-26 08:27:28 UTC
Created attachment 32297 [details]
Ouput from  xkbcomp :0 -xkb out.xkb
Comment 3 Rafal Radulski 2009-12-26 12:27:03 UTC
Created attachment 32303 [details]
Source code that recreates the bug.

Output when keyboard is set to Czechia:
keycode=11, index=0 => keysym=492
keycode=11, index=1 => keysym=50
keycode=11, index=2 => keysym=50
keycode=11, index=3 => keysym=64
Comment 4 Dirk Wallenstein 2009-12-27 02:26:53 UTC
You have to use XkbKeycodeToKeysym (mind the Xkb prefix). XKeycodeToKeysym keeps compatibility with pre-Xkb and thus only sees 2 groups with 2 levels each. It wraps the index into the next group.
Comment 5 Rafal Radulski 2009-12-27 10:04:07 UTC
Thank you very much. Your suggestion works perfectly.
Rafal


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.