test/threadwin.c
changeset 2117 40888832d785
parent 1895 c121d94672cb
child 4429 faa9fc8e7f67
equal deleted inserted replaced
2116:b42abf0a50bc 2117:40888832d785
   182         for (i = 0; i < found; ++i) {
   182         for (i = 0; i < found; ++i) {
   183             switch (events[i].type) {
   183             switch (events[i].type) {
   184                 /* We want to toggle visibility on buttonpress */
   184                 /* We want to toggle visibility on buttonpress */
   185             case SDL_KEYDOWN:
   185             case SDL_KEYDOWN:
   186             case SDL_KEYUP:
   186             case SDL_KEYUP:
   187                 printf("Key '%c' has been %s\n",
   187                 printf("Key '%c' (keysym==%d) has been %s\n",
   188                        events[i].key.keysym.unicode,
   188                        events[i].key.keysym.unicode,
       
   189                        (int) events[i].key.keysym.sym,
   189                        (events[i].key.state == SDL_PRESSED) ?
   190                        (events[i].key.state == SDL_PRESSED) ?
   190                        "pressed" : "released");
   191                        "pressed" : "released");
   191 
   192 
   192                 /* Allow hitting <ESC> to quit the app */
   193                 /* Allow hitting <ESC> to quit the app */
   193                 if (events[i].key.keysym.sym == SDLK_ESCAPE) {
   194                 if (events[i].key.keysym.sym == SDLK_ESCAPE) {