checkkeys: report SDL_TEXTEDITING events.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 01 May 2015 01:19:00 -0400
changeset 95814da24acfbd90
parent 9580 d37ef6990bf9
child 9582 e0e2e94ce5ea
checkkeys: report SDL_TEXTEDITING events.
test/checkkeys.c
     1.1 --- a/test/checkkeys.c	Fri May 01 01:12:48 2015 -0400
     1.2 +++ b/test/checkkeys.c	Fri May 01 01:19:00 2015 -0400
     1.3 @@ -121,7 +121,7 @@
     1.4  }
     1.5  
     1.6  static void
     1.7 -PrintText(char *text)
     1.8 +PrintText(char *eventtype, char *text)
     1.9  {
    1.10      char *spot, expanded[1024];
    1.11  
    1.12 @@ -131,7 +131,7 @@
    1.13          size_t length = SDL_strlen(expanded);
    1.14          SDL_snprintf(expanded + length, sizeof(expanded) - length, "\\x%.2x", (unsigned char)*spot);
    1.15      }
    1.16 -    SDL_Log("Text (%s): \"%s%s\"\n", expanded, *text == '"' ? "\\" : "", text);
    1.17 +    SDL_Log("%s Text (%s): \"%s%s\"\n", eventtype, expanded, *text == '"' ? "\\" : "", text);
    1.18  }
    1.19  
    1.20  void
    1.21 @@ -147,8 +147,11 @@
    1.22          case SDL_KEYUP:
    1.23  		    PrintKey(&event.key.keysym, (event.key.state == SDL_PRESSED) ? SDL_TRUE : SDL_FALSE, (event.key.repeat) ? SDL_TRUE : SDL_FALSE);
    1.24              break;
    1.25 +        case SDL_TEXTEDITING:
    1.26 +            PrintText("EDIT", event.text.text);
    1.27 +            break;
    1.28          case SDL_TEXTINPUT:
    1.29 -            PrintText(event.text.text);
    1.30 +            PrintText("INPUT", event.text.text);
    1.31              break;
    1.32          case SDL_MOUSEBUTTONDOWN:
    1.33              /* Any button press quits the app... */