test/checkkeys.c
changeset 7312 b36811d7db33
parent 7191 75360622e65f
child 7317 37b77749523b
equal deleted inserted replaced
7311:56e66417dcee 7312:b36811d7db33
   105                 "Unknown Key (scancode %d = %s) %s ",
   105                 "Unknown Key (scancode %d = %s) %s ",
   106                 sym->scancode,
   106                 sym->scancode,
   107                 SDL_GetScancodeName(sym->scancode),
   107                 SDL_GetScancodeName(sym->scancode),
   108                 pressed ? "pressed " : "released");
   108                 pressed ? "pressed " : "released");
   109     }
   109     }
   110 
       
   111     /* Print the translated character, if one exists */
       
   112     if (sym->unicode) {
       
   113         /* Is it a control-character? */
       
   114         if (sym->unicode < ' ') {
       
   115             print_string(&spot, &left, " (^%c)", sym->unicode + '@');
       
   116         } else {
       
   117 #ifdef UNICODE
       
   118             print_string(&spot, &left, " (%c)", sym->unicode);
       
   119 #else
       
   120             /* This is a Latin-1 program, so only show 8-bits */
       
   121             if (!(sym->unicode & 0xFF00))
       
   122                 print_string(&spot, &left, " (%c)", sym->unicode);
       
   123             else
       
   124                 print_string(&spot, &left, " (0x%X)", sym->unicode);
       
   125 #endif
       
   126         }
       
   127     }
       
   128     print_modifiers(&spot, &left);
   110     print_modifiers(&spot, &left);
   129     if (repeat) {
   111     if (repeat) {
   130         print_string(&spot, &left, " (repeat)");
   112         print_string(&spot, &left, " (repeat)");
   131     }
   113     }
   132     SDL_Log("%s\n", message);
   114     SDL_Log("%s\n", message);