Check if running on Steam Deck

Hi there,
I don’t have a Steam Deck dev-kit, but my game does run on that platform. However, I can’t seem to find a way to (in runtime) distinguish if the game is currently running on Linux or the Steam Deck. Usually one would check Application.platform, but even in 2021.3, there is no enum value for the SteamDeck…

Any ideas?

Thanks!

Logically speaking steam deck is Linux.

A good idea would be to contact valve support and ask them this question.

You could also try poking /proc at runtime to determine CPU type, as it is supposed to be a fairly custom one.

https://partner.steamgames.com/doc/steamdeck/testing

Thank you, no info about this question there, tho.
I also asked on the Steamworks forum, will post here if I get an answer.

1 Like

Ah, I hoped something would pop up there on the topic. I haven’t gone through the material yet.

My deck is on its way, but it’s retail. I hear all devkit related content is publicly available so hopefully it won’t lack much on dev side of things.

The folks at Steam answered
Al long as you have a reference to Steamworks, you can check Steamworks.SteamUtils.IsSteamRunningOnSteamDeck();

14 Likes

You could also place an option in your user options section for whatever reason you need to know if it’s on Steam Deck. I’m guessing because you want to alter your UI for a small screen. You could add a “Small Screen UI” checkbox in your graphics options which would be useful for anyone who is running your software on a small screen, not just Steam Deck users. Autodetecting Steamdeck can set the default value.

1 Like

I don’t know about Windows games running on Steam Deck, but my Linux-native build reports this metadata:

SystemInfo.DeviceModel: PC
SystemInfo.DeviceType: Desktop
Application.platform: LinuxPlayer
SystemInfo.OperatingSystem: Linux 5.13 SteamOS 3.3.1 64bit
SystemInfo.OperatingSystemFamily: Linux
Input.GetJoystickNames(): Steam Virtual Gamepad

So I’m using SystemInfo.operatingSystem.Contains(“SteamOS”) if I need to know the device before Steamworks.NET initializes.

After that I use Steamworks.SteamUtils.IsSteamRunningOnSteamDeck();

9 Likes

Was going to look into this as I’ve just received my steam deck

Official Steam documentation is here:

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

According to Steam’s readme.txt that comes with the Steamworks API:

v1.52 14th September 2021
ISteamUtils
* Added IsSteamRunningOnSteamDeck - Can be used to optimize the experience of the game on Steam Deck, such as scaling the UI appropriately, applying performance related settings, etc.

You can download the Steamworks API here:
https://partner.steamgames.com/doc/gettingstarted

Luckily, the Steamworks.NET thing is version 1.55 of Steam, so gonna try that out and report back here on how it goes:
Releases · rlabrecque/Steamworks.NET · GitHub

Right now my build for Linux is working perfectly on the Steam Deck, flawlessly even, all that’s left is to add the inputs using the Steam API. ¯_(ツ)_/¯

2 Likes

The only reason I want to do it is because they map the controls to keys and it looks bad if they press the dpad and it says they pressed the ‘P’ key. Plus I check for ‘P’ key in my code to ‘Pause’ but don’t want to if it is really the dpad. The mix of keyboard/mouse, controller and touch interfaces just make set up complex.

Its actually easy with the Player Input component

1 Like

Just solved this after a while, just do :

SystemInfo.deviceName==“steamdeck”

That will check if you are running on a Steam Deck

1 Like