From 5441d33c0e23a306b15428c97d7f04bc522c1fcf Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 9 Oct 2025 20:58:56 -0700
Subject: [PATCH] testime: toggle text input with a mouse click
---
test/testime.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/test/testime.c b/test/testime.c
index 7292302f93eaa..9160945b1b07d 100644
--- a/test/testime.c
+++ b/test/testime.c
@@ -1044,6 +1044,14 @@ int main(int argc, char *argv[])
ToggleSettings(ctx);
} else if (ctx->settings_visible) {
ClickSettings(ctx, point.x, point.y);
+ } else {
+ if (SDL_TextInputActive(ctx->window)) {
+ SDL_Log("Disabling text input\n");
+ SDL_StopTextInput(ctx->window);
+ } else {
+ SDL_Log("Enabling text input\n");
+ SDL_StartTextInput(ctx->window);
+ }
}
break;
}