test/checkkeys.c
changeset 4560 95352c671a6e
parent 2315 95586dfe1992
child 5081 25d4feb7c127
--- a/test/checkkeys.c	Tue Jul 20 00:57:01 2010 -0700
+++ b/test/checkkeys.c	Tue Jul 20 23:25:24 2010 -0700
@@ -53,7 +53,7 @@
 }
 
 static void
-PrintKey(SDL_keysym * sym, int pressed)
+PrintKey(SDL_keysym * sym, SDL_bool pressed, SDL_bool repeat)
 {
     /* Print the keycode, name and state */
     if (sym->sym) {
@@ -87,6 +87,9 @@
         }
     }
     print_modifiers();
+    if (repeat) {
+        printf(" (repeat)");
+    }
     printf("\n");
 }
 
@@ -134,10 +137,8 @@
         SDL_WaitEvent(&event);
         switch (event.type) {
         case SDL_KEYDOWN:
-            PrintKey(&event.key.keysym, 1);
-            break;
         case SDL_KEYUP:
-            PrintKey(&event.key.keysym, 0);
+            PrintKey(&event.key.keysym, event.key.state, event.key.repeat);
             break;
         case SDL_TEXTINPUT:
             PrintText(event.text.text);