X11DRV_GetKeyNameText not finding scan code

tom fogal tfogal at cisunix.unh.edu
Sun Feb 6 00:12:35 CST 2005

Hi all, I'm a newbie to wine coding trying to get a particular
application to work. It seems to have trouble getting input correctly,
and I've traced it to the aforementioned function in
dlls/x11drv/keyboard.c. I'm using the wine CVS.

The function seems to search through a particular table (keyc2scan) and
I think the problem is that the key I am pressing is not in the table
-- I've verified that it is not finding a ton of keypresses, although I
can't see a console while the app is running so I can associate a
particular value with a particular keypress.

The general problem seems common among win32 && Xlib, at least.
Application developers want to see which key is pressed, but different
keys have different meanings/values depending on the current locale and
maybe other settings. wine's GetKeyNameText seems to map that
particular winapi call to XKeysymToString(XKeycodeToKeysym) calls,
which sounds right.

The table gets built in X11DRV_InitKeyboard, AFAICT. I can't see
anything wrong with the way it is built -- although there is a huge
chunk of code #ifdef 0'd out ("/* this breaks VK_OEM_x VKeys in some
layout tables [. . .]").

I'm lost as to what minor detail wine seems to be missing here, it
seems consistent with MSDN docs I've found online. Are there known
issues with this piece of wine? Is anyone exactly sure what this
function should be returning (aka "a\0" in lpBuffer and a retval of 1,
for pressing the 'a' key? or some code that means 'a'?) ?
Most importantly, whats the next step in debugging this?



More information about the wine-devel mailing list