comparison src/events/SDL_keyboard.c @ 4882:e725a6a60c32

Ensure compositions are committed when keyboard focus changes. There may be a better way to do this.
author dewyatt
date Wed, 15 Sep 2010 00:28:19 -0400
parents 518d1679d2d0
children 443771460df9
comparison
equal deleted inserted replaced
4881:0972c2893e68 4882:e725a6a60c32
610 610
611 /* See if the current window has lost focus */ 611 /* See if the current window has lost focus */
612 if (keyboard->focus && keyboard->focus != window) { 612 if (keyboard->focus && keyboard->focus != window) {
613 SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_LOST, 613 SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_LOST,
614 0, 0); 614 0, 0);
615
616 //Ensures IME compositions are committed
617 if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
618 SDL_GetVideoDevice()->StopTextInput(SDL_GetVideoDevice());
619 }
615 } 620 }
616 621
617 keyboard->focus = window; 622 keyboard->focus = window;
618 623
619 if (keyboard->focus) { 624 if (keyboard->focus) {