[Xcb] xcb_key_press_lookup_keysym and numpad keys

Michael Stapelberg michael+xcb at stapelberg.de
Sat Nov 6 10:29:48 PDT 2010


Hi there,

for i3lock [1] I use xcb’s xcb_key_press_lookup_keysym. I recently got a
bugreport [2] stating that the user could not use his numpad keys at all. After
verifying that, it seems that he’s right: passing xcb_key_press_event_ts to
xcb_key_press_lookup_keysym does not work for numpad keys.

I created a proof of concept for xcb and xlib, both times using keycode 83
(XK_KP_4) with state 0x10. On Xlib, it works (no surprise there, but I guess it
uses XKB or some other workarounds), on xcb, it doesn’t:

michael $ ./xcb
sym = 0 (0x0000)
sym = 0 (0x0000)
sym = 65430 (0xff96)

michael $ ./xlib
nbytes = 1
ks=  65460 (ffb4)

The first two lines by `xcb` are with state = 0x10 and state = 0x11
respectively. Both do not spit out any keysyms. However, with state = 0, I get
0xff96, which is XK_KP_Left (same as Shift + XK_KP_4). Interestingly, `xmodmap
-pke | grep 83` spits out keycode  83 = KP_Left KP_4 KP_Left KP_4 KP_Left KP_4
(so exactly the opposite of what I would assume with regard to the shift
behaviour).

Can somebody enlighten me on why this happens? Is it a bug in xcb-util
(xcb-keysyms)? Do I need to use XKB?

Best regards,
Michael

[1] http://i3.zekjur.net/i3lock/
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=602101
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: xcb.c
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20101106/01b5e325/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: xlib.c
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20101106/01b5e325/attachment.asc>


More information about the Xcb mailing list