Why double translation on keydown?

Dmitry Timoshkov dmitry at codeweavers.com
Sun Apr 8 00:44:30 CDT 2007

"Shachar Shemesh" <shachar at shemesh.biz> wrote:

>> X11DRV_ToUnicodeEx is a backend of the Win32 API ToUnicodeEx and it takes
>> a virtual key code. I.e. ToUnicodeEx takes a predefined input and should
>> return data very closely resembling what Windows does.
> Ok, then maybe we should have TranslateMessage not call that, and use
> something else instead?

For instance what? Apparently Windows does use ToUnicodeEx internally in
TranslateMessage, if you are planning to change that you have to make sure
that current semantics doesn't change. In any case nothing prevents the apps
to call ToUnicodeEx on their own while handling WM_KEYxxxx messages.

> This is particularly prominent from this
> sentence in the ToUnicodeEx documentation
> (http://msdn2.microsoft.com/en-us/library/ms646322.aspx):
>> The parameters supplied to the ToUnicodeEx function might not be
>> sufficient to translate the virtual-key code because a previous dead
>> key is stored in the keyboard layout.
> Maybe I don't understand the code well enough, but it seems to me that
> we report on the dead-key press, but not translate the following
> character. Is that correct?

winex11.drv never reports dead keys to the applications, dead keys are
handled internally.


More information about the wine-devel mailing list