test/checkkeys.c
changeset 9581 4da24acfbd90
parent 9580 d37ef6990bf9
child 9607 7746ab058d12
--- a/test/checkkeys.c	Fri May 01 01:12:48 2015 -0400
+++ b/test/checkkeys.c	Fri May 01 01:19:00 2015 -0400
@@ -121,7 +121,7 @@
 }
 
 static void
-PrintText(char *text)
+PrintText(char *eventtype, char *text)
 {
     char *spot, expanded[1024];
 
@@ -131,7 +131,7 @@
         size_t length = SDL_strlen(expanded);
         SDL_snprintf(expanded + length, sizeof(expanded) - length, "\\x%.2x", (unsigned char)*spot);
     }
-    SDL_Log("Text (%s): \"%s%s\"\n", expanded, *text == '"' ? "\\" : "", text);
+    SDL_Log("%s Text (%s): \"%s%s\"\n", eventtype, expanded, *text == '"' ? "\\" : "", text);
 }
 
 void
@@ -147,8 +147,11 @@
         case SDL_KEYUP:
 		    PrintKey(&event.key.keysym, (event.key.state == SDL_PRESSED) ? SDL_TRUE : SDL_FALSE, (event.key.repeat) ? SDL_TRUE : SDL_FALSE);
             break;
+        case SDL_TEXTEDITING:
+            PrintText("EDIT", event.text.text);
+            break;
         case SDL_TEXTINPUT:
-            PrintText(event.text.text);
+            PrintText("INPUT", event.text.text);
             break;
         case SDL_MOUSEBUTTONDOWN:
             /* Any button press quits the app... */