Fixed X11 build, added code to print initial modifiers to checkkeys

This commit is contained in:
Sam Lantinga 2015-05-28 09:52:48 -07:00
parent 6480b36e2e
commit aafa101499
2 changed files with 91 additions and 73 deletions

View file

@ -88,6 +88,20 @@ print_modifiers(char **text, size_t *maxlen)
print_string(text, maxlen, " MODE");
}
static void
PrintModifierState()
{
char message[512];
char *spot;
size_t left;
spot = message;
left = sizeof(message);
print_modifiers(&spot, &left);
SDL_Log("Initial state:%s\n", message);
}
static void
PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat)
{
@ -200,6 +214,10 @@ main(int argc, char *argv[])
SDL_StartTextInput();
/* Print initial modifier state */
SDL_PumpEvents();
PrintModifierState();
/* Watch keystrokes */
done = 0;