From 59857acd08bdd345fff89603ddfa32b2e71d01a8 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 20 Mar 2025 16:08:15 -0700
Subject: [PATCH] Always show the on-screen keyboard on Steam Deck
Steam will eventually have smarts about whether a keyboard is active and will igore the request appropriately.
Fixes https://github.com/libsdl-org/SDL/issues/12595
(cherry picked from commit 03a53ce0d12163ee5f7986f9603d2ac010fba947)
---
src/video/SDL_video.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index ebad40d8b181b..a436000063b67 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -5405,6 +5405,10 @@ bool SDL_GetTextInputMultiline(SDL_PropertiesID props)
static bool AutoShowingScreenKeyboard(void)
{
const char *hint = SDL_GetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD);
+ if (!hint) {
+ // Steam will eventually have smarts about whether a keyboard is active, so always request the on-screen keyboard on Steam Deck
+ hint = SDL_GetHint("SteamDeck");
+ }
if (((!hint || SDL_strcasecmp(hint, "auto") == 0) && !SDL_HasKeyboard()) ||
SDL_GetStringBoolean(hint, false)) {
return true;