test/testime.c
changeset 7663 53fe1b64eb2d
parent 7639 9406b7dd2f2d
child 7677 871d43c6968a
equal deleted inserted replaced
7662:d31efd717578 7663:53fe1b64eb2d
   133 
   133 
   134     markedRect.x = textRect.x + w;
   134     markedRect.x = textRect.x + w;
   135     markedRect.w = textRect.w - w;
   135     markedRect.w = textRect.w - w;
   136     if (markedRect.w < 0)
   136     if (markedRect.w < 0)
   137     {
   137     {
   138         // Stop text input because we cannot hold any more characters
   138         /* Stop text input because we cannot hold any more characters */
   139         SDL_StopTextInput();
   139         SDL_StopTextInput();
   140         return;
   140         return;
   141     }
   141     }
   142     else
   142     else
   143     {
   143     {
   340                     if (SDL_strlen(text) + SDL_strlen(event.text.text) < sizeof(text))
   340                     if (SDL_strlen(text) + SDL_strlen(event.text.text) < sizeof(text))
   341                         SDL_strlcat(text, event.text.text, sizeof(text));
   341                         SDL_strlcat(text, event.text.text, sizeof(text));
   342 
   342 
   343                     SDL_Log("text inputed: %s\n", text);
   343                     SDL_Log("text inputed: %s\n", text);
   344 
   344 
   345                     // After text inputed, we can clear up markedText because it
   345                     /* After text inputed, we can clear up markedText because it */
   346                     // is committed
   346                     /* is committed*/
   347                     markedText[0] = 0;
   347                     markedText[0] = 0;
   348                     Redraw();
   348                     Redraw();
   349                     break;
   349                     break;
   350 
   350 
   351                 case SDL_TEXTEDITING:
   351                 case SDL_TEXTEDITING: