X11: send keypress events before textinput events.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 01 May 2015 01:20:28 -0400
changeset 9582 e0e2e94ce5ea
parent 9581 4da24acfbd90
child 9583 0bd764eb2b99
X11: send keypress events before textinput events.
src/video/x11/SDL_x11events.c
--- a/src/video/x11/SDL_x11events.c	Fri May 01 01:19:00 2015 -0400
+++ b/src/video/x11/SDL_x11events.c	Fri May 01 01:20:28 2015 -0400
@@ -755,19 +755,17 @@
 #else
             XLookupString(&xevent.xkey, text, sizeof(text), &keysym, NULL);
 #endif
+
 #ifdef SDL_USE_IBUS
             if(SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE){
-                if(!(handled_by_ime = SDL_IBus_ProcessKeyEvent(keysym, keycode))){
-#endif
-                    if(*text){
-                        SDL_SendKeyboardText(text);
-                    }
-#ifdef SDL_USE_IBUS
-                }
+                handled_by_ime = SDL_IBus_ProcessKeyEvent(keysym, keycode);
             }
 #endif
             if (!handled_by_ime) {
                 SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]);
+                if(*text) {
+                    SDL_SendKeyboardText(text);
+                }
             }
 
         }