comparison src/events/SDL_keyboard.c @ 4763:518d1679d2d0

Merged Daniel's Google Summer of Code work from SDL-gsoc2010_IME
author Sam Lantinga <slouken@libsdl.org>
date Sun, 22 Aug 2010 12:39:27 -0700
parents 833a225613e2 436183eb30c8
children e725a6a60c32
comparison
equal deleted inserted replaced
4762:833a225613e2 4763:518d1679d2d0
776 posted = 0; 776 posted = 0;
777 if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { 777 if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) {
778 SDL_Event event; 778 SDL_Event event;
779 event.text.type = SDL_TEXTINPUT; 779 event.text.type = SDL_TEXTINPUT;
780 event.text.windowID = keyboard->focus ? keyboard->focus->id : 0; 780 event.text.windowID = keyboard->focus ? keyboard->focus->id : 0;
781 SDL_strlcpy(event.text.text, text, SDL_arraysize(event.text.text)); 781 SDL_utf8strlcpy(event.text.text, text, SDL_arraysize(event.text.text));
782 event.text.windowID = keyboard->focus ? keyboard->focus->id : 0; 782 event.text.windowID = keyboard->focus ? keyboard->focus->id : 0;
783 posted = (SDL_PushEvent(&event) > 0); 783 posted = (SDL_PushEvent(&event) > 0);
784 } 784 }
785 return (posted); 785 return (posted);
786 } 786 }
797 SDL_Event event; 797 SDL_Event event;
798 event.edit.type = SDL_TEXTEDITING; 798 event.edit.type = SDL_TEXTEDITING;
799 event.edit.windowID = keyboard->focus ? keyboard->focus->id : 0; 799 event.edit.windowID = keyboard->focus ? keyboard->focus->id : 0;
800 event.edit.start = start; 800 event.edit.start = start;
801 event.edit.length = length; 801 event.edit.length = length;
802 SDL_strlcpy(event.edit.text, text, SDL_arraysize(event.edit.text)); 802 SDL_utf8strlcpy(event.edit.text, text, SDL_arraysize(event.edit.text));
803 posted = (SDL_PushEvent(&event) > 0); 803 posted = (SDL_PushEvent(&event) > 0);
804 } 804 }
805 return (posted); 805 return (posted);
806 } 806 }
807 807