KeyCode doesn't work when IME is enabled

Hi,

I am working on Input Key pressed event and currently using english/korean keyboard input. I noticed that when I enable korean ime, the input keys don’t work. But it works perfectly fine when I switch it back to english.
For example, if with the code below, when I press ‘z’ key, it only works with english input enabled.

if(Input.GetKey(KeyCode.Z)) {
// some event
}

And it seems to happen only on windows, when I tried it on Mac, the key worked fine even with korean input enabled.

I tried to turn off ime using
Input.imeCompositionMode = IMECompositionMode.Off
to use only english as my input, but it still didn’t work. When I typed something in text box with korean Ime enabled, I was still able to write korean. Does anyone having same problem?

I am using unity version 5.3.4f1 on windows 10.

Not quite an answer to the original question, but as per this post the IME mode is actually set by the input field in late update so it’ll always be on: https://forum.unity.com/threads/cant-disable-ime-keyboard-for-text-input.1327008/#post-8387979

Once I realized I couldn’t get input events I started looking for a way to check if the IME was open/closed, but aside from Input.imeIsSelected and Input.imeCompositionMode unity dosen’t really give you any way to interface with the IME. Neither of them really helped (imeIsSelected is true as long as the UI element is selected, and imeCompositionMode is always set to ON by the input field while its selected).

So I pressed on, looking for SOMETHING I could use to determine if the player had finished their input. Found some more IME dead ends and stumbled upon Input.ForwardRawInput while thinking I could maybe get input directly from some windows api, but that was way more involved and low level than I was willing to deal with.

Eventually I came across the Event class and that’s what I ended up using. Specifically Event.current. It still doesn’t return everything, the normal letter keys are still being overriden by the IME stuff, and I wasn’t able to get a Return/Enter down event but I WAS able to get a Return/Enter up event, which is ultimately what I used to figure out when the user was done with their input / the IME was closed. Not perfect, but hopefully it’s enough to help someone. This was also all done using the old input system (localization happened way too late in development to switch everything over) so there might be something in there that’d streamline things but with how little mention of IME in unity there is I doubt it.