[Xcb] xcb equivalent of XKeysymToKeycode?

Jon Shemitz jshemitz at sta.samsung.com
Mon Oct 11 16:41:08 PDT 2010


I can get xcb_test_fake_input to work just fine, when I pass it the proper keycodes as per xev and/or xmodmap -pke. I could code a mapping from keycap to keycode based on xmodmap -pke, but I'm reluctant to do this: my desktop Ubuntu is using a different mapping of keycodes to keysyms than the target system, and I don't really know where this difference is coming from. (So, I can have no confidence that the target system won't change, or that someone else's instance of the target system will behave like mine.)

I did find some sample xlib code that uses XKeysymToKeycode to turn key symbols like XK_A and XK_TAB into xtest-compatible keycodes.

Is there an xcb equivalent of XKeysymToKeycode? Or, is there some standard file somewhere I can read at runtime to build my mapping? Or, do I have to evaluate `xmodmap -pke` and parse it for lines that map keycodes to symbols?

Sorry to be so helpless! I would sure like to avoid option #3 - it wouldn't take all that long, but it feels really ugly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20101011/bd0f643e/attachment.htm>


More information about the Xcb mailing list