X11: send keypress events before textinput events.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 01 May 2015 01:20:28 -0400
changeset 9582e0e2e94ce5ea
parent 9581 4da24acfbd90
child 9583 0bd764eb2b99
X11: send keypress events before textinput events.
src/video/x11/SDL_x11events.c
     1.1 --- a/src/video/x11/SDL_x11events.c	Fri May 01 01:19:00 2015 -0400
     1.2 +++ b/src/video/x11/SDL_x11events.c	Fri May 01 01:20:28 2015 -0400
     1.3 @@ -755,19 +755,17 @@
     1.4  #else
     1.5              XLookupString(&xevent.xkey, text, sizeof(text), &keysym, NULL);
     1.6  #endif
     1.7 +
     1.8  #ifdef SDL_USE_IBUS
     1.9              if(SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE){
    1.10 -                if(!(handled_by_ime = SDL_IBus_ProcessKeyEvent(keysym, keycode))){
    1.11 -#endif
    1.12 -                    if(*text){
    1.13 -                        SDL_SendKeyboardText(text);
    1.14 -                    }
    1.15 -#ifdef SDL_USE_IBUS
    1.16 -                }
    1.17 +                handled_by_ime = SDL_IBus_ProcessKeyEvent(keysym, keycode);
    1.18              }
    1.19  #endif
    1.20              if (!handled_by_ime) {
    1.21                  SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]);
    1.22 +                if(*text) {
    1.23 +                    SDL_SendKeyboardText(text);
    1.24 +                }
    1.25              }
    1.26  
    1.27          }