WM_INPUT for keyboard - worth it?

Started by
11 comments, last by cow_in_the_well 15 years, 3 months ago
Hmm, I dunno... I've never had to use ToUnicode with a keyboard layout that actually used dead keys, so I'm not sure [smile]

You might try ToUnicode instead. The only difference is that ToUnicodeEx takes a HKL whereas ToUnicode just uses the currently active one. I don't know if that'd make a difference, though.
Advertisement
Nah that doesn't make any difference unfortunately. Just as proof that it's not handling the dead-keys for me, I press two "'" in a row:

ToUnicodeEx: result is -1 (39 0 8339 126)
ToUnicodeEx: result is -1 (39 0 8339 126)

You would have thought the second call would have returned 1, since pressing ' twice should display two ' characters (as it does in Notepad in Spanish mode).

Hmm. Just thinking - where is the dead-key state held? I'm guessing the Windows keyboad layer holds it. How does it get reset? I'm wondering if DefWinodwProc or something is calling ToUnicode itself and then resetting the state for when _I_ call ToUnicodeEx on the second key...investigating now...

- Thomas Cowellwebsite | journal | engine video

:D! My suspicions paid off - WM_CHAR/WM_DEADCHAR was still being called even though I was returning 0 from WM_INPUT. I set the RIDEV_NOLEGACY flag on my call to RegisterRawInputDevices and ToUnicodeEx works perfectly, just as expected :).

Thanks guys. Everything is now going to plan :).

- Thomas Cowellwebsite | journal | engine video

This topic is closed to new replies.

Advertisement