-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Opening the on-screen keyboard with standard APIs #668
Comments
Hi! Gamescope has nothing to do with the Steam keyboard -- that's provided entirely by Steam. There are two possible options we could do to make this work: Option 1SDL gets the GAMESCOPE_WAYLAND_DISPLAY, and uses its existing text_input_v3 interface to talk to Gamescope, which talks to Steam to open the keyboard. We do technically support Wayland clients -- just not xdg-shell after all. Option 2SDL detects its running on Gamescope by checking the root window of the DISPLAY. SDL uses xdg-open or whatever and just calls Some games on Steam that are bound by older Steam APIs as they use crappy middleware, etc end up doing this. Maybe @slouken has an opinion on what method they would like in SDL? |
Option 2 would probably be the best route for the x11 driver - we could implement HasScreenKeyboard to check for gamescope, then StartTextInput could call the deeplink. We would probably just use whatever values make the equivalent of pressing Steam+X, if possible. |
Option 2 needs nothing from our side so feel free to give it a shot if you think thats the best. |
I'll throw together a draft today - for Wayland clients we should definitely use the official protocol, but that can come from gamescope later IMO (SDL3?). |
Option 2 is also extendable to other environments, so I would vote for that as well. |
I would implement it via the ScreenKeyboard internal API, and call SDL_OpenURL() to open the on-screen keyboard. Maybe this is appropriate for src/core/steam/SDL_steam.c? |
We probably want to account for the case where there's a hardware keyboard attached? |
Steam should handle that in the |
This can now be seen in action with Salt & Sanctuary's native Linux version (which is currently being overridden by force, grumble): https://steamcommunity.com/games/SaltandSanctuary/announcements/detail/5023230335822734611 |
Currently Valve asks applications to interact with the on-screen keyboard via proprietary APIs, such as ShowGamepadTextInput - this is okay for new games, but for older games there is already prior art for interacting with the on-screen keyboard, namely SDL's text input API. On Wayland we actually have really good on-screen keyboard support thanks to the text-input-v3 protocol, which does a great job of not only showing the keyboard but only doing so when a physical keyboard isn't present - once gamescope supports native Wayland clients (#543) this will all hopefully Just Work for many existing native SDL titles!
For now though, we're of course using Xwayland, and SDL's X11 driver does have support for ibus/fcitx, but I'm not aware of any standard way to interact with the on-screen keyboard - does gamescope/wlroots expose this to X applications in some way? If we can add this to SDL, it would be a huge help for existing games; I've lost count of how many games I've had completely fail Deck cert because SDL_StartTextInput doesn't work on Steam Deck, even though it works great on normal Linux systems, and unfortunately updating Steamworks is not as trivial as updating SDL.
For reference, here's SDL's...
The text was updated successfully, but these errors were encountered: