IME - How to Deal with a Key Press

In my game code, I handle the key input by processing the message WM_KEYDOWN

. wParam gives me the code I need.

The problem is with the IME, especially KoreanIME. I get WM_IME_COMPOSITION

, then WM_KEYUP

, but never WM_KEYDOWN

.

So the bottom line. I need to get the key code when I receive it WM_IME_COMPOSITION

. Is there a way to do this?

Any help would be greatly appreciated. Thank!

+2


source to share


2 answers


according to http://msdn.microsoft.com/en-us/library/dd374133(VS.85).aspx the composite key is in wParam encoded as DBCS ( http://www.microsoft.com/typography/unicode /cs.htm ). I am assuming you need to extract the corresponding byte from the word and decide accordingly.



0


source


I know this is a little late, but for others one can use

BOOL ImmDisableIME(
  __in  DWORD idThread
);

      



Pass in the id of the UI thread that handles keystrokes.

http://msdn.microsoft.com/en-us/library/dd318535(v=VS.85).aspx

0


source







All Articles