How can I detect if my app is running on a Steam Deck in Solar2D?

Is there a way to detect if my Solar2D app is running on a Steam Deck?

1 Like

Hello @aclementerodrguez
perhaps with “system.getInfo()” you will get the information.

Sincerely,
Yvan.

Thank you @Yvan . Unfortunately there is no feature available through system.getInfo() that can determine whether your game is running on a Steam Deck.

One workaround that I can think of is to consider using system.pathforfile and look for a Steam Deck exclusive file somewhere on the system? I am not too familiar with linux so I don’t know how reliable this approach will be but on a windows modding tool I had made for another game, I was able to use this approach as a very basic measure to ensure that users were properly copying in the prerequisite files before launching the tool.

2 Likes

Thanks, @famousdoggstudios, that’s a viable implementation. I’ll look into it.

The Steamworks API includes a feature that can determine whether the app is running on a Steam Deck:

From the Steam documentation:

bool IsSteamRunningOnSteamDeck();
Checks if Steam is running on a Steam Deck or any other SteamOS device.

Hey @Scott_Harrison, could you please take a look at this?
It would be great to integrate this feature into our Steam plugin.

url:
https://partner.steamgames.com/doc/api/ISteamUtils

2 Likes

The Steam Deck’s resolution seems to be unusual. (1280x800) You could try display.actualContentWidth and display.actualContentHeight as a way of determining if the app is running on a Steam Deck. (You’d want to have an access to a Steam Deck for testing to see if it actually works…)

1 Like

Thank you colinmorgan… I’ll try this. Unfortunately I don’t have a Steam Deck.

Out of curiosity- why do you want to know if the app is running on a Steam Deck?

Because I have some texts like “Right arrow key to continue…” or “R to restart” and so on.

That makes sense.

But if Valve suddenly makes a “Steam Deck 2” with a bigger screen, the code won’t be effective.