src/video/x11/SDL_x11events.c
changeset 10572 8b8a45c000f9
parent 10570 251691cfeaa0
child 10609 d702ecbd8ba7
equal deleted inserted replaced
10571:be7bd04d8342 10572:8b8a45c000f9
   583                 SDL_SendKeyboardKey(SDL_RELEASED, scancode);
   583                 SDL_SendKeyboardKey(SDL_RELEASED, scancode);
   584             }
   584             }
   585 #endif
   585 #endif
   586         }
   586         }
   587         return;
   587         return;
   588     } else if (orig_keycode == videodata->filter_code && xevent.xkey.time == videodata->filter_time) {
       
   589         /* This is a duplicate event, resent by an IME - skip it. */
       
   590         return;
       
   591     }
   588     }
   592 
   589 
   593     /* Send a SDL_SYSWMEVENT if the application wants them */
   590     /* Send a SDL_SYSWMEVENT if the application wants them */
   594     if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) {
   591     if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) {
   595         SDL_SysWMmsg wmmsg;
   592         SDL_SysWMmsg wmmsg;
   800             if(SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE){
   797             if(SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE){
   801                 handled_by_ime = SDL_IME_ProcessKeyEvent(keysym, keycode);
   798                 handled_by_ime = SDL_IME_ProcessKeyEvent(keysym, keycode);
   802             }
   799             }
   803 #endif
   800 #endif
   804             if (!handled_by_ime) {
   801             if (!handled_by_ime) {
   805                 SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]);
   802                 /* Don't send the key if it looks like a duplicate of a filtered key sent by an IME */
       
   803                 if (xevent.xkey.keycode != videodata->filter_code || xevent.xkey.time != videodata->filter_time) {
       
   804                     SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]);
       
   805                 }
   806                 if(*text) {
   806                 if(*text) {
   807                     SDL_SendKeyboardText(text);
   807                     SDL_SendKeyboardText(text);
   808                 }
   808                 }
   809             }
   809             }
   810 
   810