src/events/SDL_keyboard.c
branchgsoc2009_IME
changeset 3132 88861448961f
parent 2990 502adab079a4
     1.1 --- a/src/events/SDL_keyboard.c	Wed Jul 01 05:52:17 2009 +0000
     1.2 +++ b/src/events/SDL_keyboard.c	Wed Jul 01 07:33:58 2009 +0000
     1.3 @@ -852,6 +852,24 @@
     1.4      return (posted);
     1.5  }
     1.6  
     1.7 +int
     1.8 +SDL_SendEditingText(const char *text, int start, int length)
     1.9 +{
    1.10 +    int posted;
    1.11 +
    1.12 +    /* Post the event, if desired */
    1.13 +    posted = 0;
    1.14 +    if (SDL_ProcessEvents[SDL_TEXTEDITING] == SDL_ENABLE) {
    1.15 +        SDL_Event event;
    1.16 +        event.edit.type = SDL_TEXTEDITING;
    1.17 +        event.edit.start = start;
    1.18 +        event.edit.length = length;
    1.19 +        SDL_strlcpy(event.edit.text, text, SDL_arraysize(event.text.text));
    1.20 +        posted = (SDL_PushEvent(&event) > 0);
    1.21 +    }
    1.22 +    return (posted);
    1.23 +}
    1.24 +
    1.25  void
    1.26  SDL_KeyboardQuit(void)
    1.27  {