[Xcb] xcb_key_press_lookup_keysym and numpad keys

Julien Danjou julien at danjou.info
Mon Nov 8 01:48:16 PST 2010

On Sat, Nov 06 2010, Michael Stapelberg wrote:

>     xcb_keysym_t sym = xcb_key_press_lookup_keysym(symbols, &event, event.state);

This is wrong. The 3rd argument is a column, not an event state.

I suggest you:
1. Read xcb_key_symbols_get_keysym() comments on top of the function in
   xcb-util's keysym.c. Read until you understand it completely. :)
2. Take a look at awesome's keyresolver[1], which is the best
   implementation I'm aware of in this area.

And yes, you should use XKB to have a real keyboard support. Even with
awesome's code, you won't be able to support correctly all keyboards and
their complicated variants.

[1] http://git.naquadah.org/?p=awesome.git;a=blob;f=keyresolv.c;h=80b1ebf586ee5bd4f676aaf1f390064e82db4fc3;hb=HEAD

Julien Danjou
// ᐰ <julien at danjou.info>   http://julien.danjou.info

More information about the Xcb mailing list