Skip to content

Commit

Permalink
Fixed bug 3682 - Toggle text input in checkkeys when the mouse is cli…
Browse files Browse the repository at this point in the history
…cked

Eric Wasylishen

Small change to checkkeys so you can toggle text input mode with a mouse click.
This is needed for testing how dead keys react to toggling mouse input, i.e. these bugs:
  • Loading branch information
slouken committed Aug 11, 2017
1 parent 9630583 commit 222bacd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/checkkeys.c
Expand Up @@ -168,7 +168,19 @@ loop()
PrintText("INPUT", event.text.text);
break;
case SDL_MOUSEBUTTONDOWN:
/* Any button press quits the app... */
/* Left button quits the app, other buttons toggles text input */
if (event.button.button == SDL_BUTTON_LEFT) {
done = 1;
} else {
if (SDL_IsTextInputActive()) {
SDL_Log("Stopping text input\n");
SDL_StopTextInput();
} else {
SDL_Log("Starting text input\n");
SDL_StartTextInput();
}
}
break;
case SDL_QUIT:
done = 1;
break;
Expand Down

0 comments on commit 222bacd

Please sign in to comment.