Don't send SDL_KEYDOWN during IME

It is on Window OS.

I’m migrating SDL from 1.3 to 2.0.3. Dealing with keyboard input, find SDL
2.0.3 send SDL_KEYDOWN when IME, it cause trouble to me.

On application level, according to event.key parameter, it cannot
distinguish current keyboard state wheather in IME or not.

I hope that SDL don’t send SDL_KEYDOWN during IME same as SDL 1.3.

Go deep into SDL 2.0.3 source code, try to modify.

LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
lParam)

{

     ......

     case WM_KEYDOWN:

     case WM_SYSKEYDOWN:

               {

                        SDL_Scancode code =

WindowsScanCodeToSDLScanCode( lParam, wParam );

                        if (wParam != VK_PROCESSKEY && code !=

SDL_SCANCODE_UNKNOWN ) {

                                 SDL_SendKeyboardKey(SDL_PRESSED, code

);

                        }

             }

     ......

}

Change “if (code != SDL_SCANCODE_UNKNOWN)” to “if (wParam != VK_PROCESSKEY
&& code != SDL_SCANCODE_UNKNOWN)”.

FYI, I’ve reported this bug in Bugzilla.
Bug 2836 - Windows: No way to tell whether SDL_KEY* events was trapped by the IMs (https://bugzilla.libsdl.org/show_bug.cgi?id=2836)