Not 100% related to the above posts in this thread, but I found a way to programmatically determine whether or not the current device is a Steam Deck, and couldn’t find anywhere else relevant to post it, so sharing it here in case someone finds it useful. By having a way to determine whether the device is a Steam Deck, it becomes easier to do things such as adjusting the default graphic settings and so on for a better user experience.
Anyway, as far I could tell there doesn’t seem to be an easy macro for checking, like PLATFORM_WINDOWS, but I confirmed that there are some env vars which are only set on the Steam Deck. Note that some are only set in the Steam Deck’s gaming mode, whereas others are set in both the desktop and gaming modes. Here’s what I found:
Steam Deck: gaming mode:
- SteamOS:1
- SteamGamepadUI:1
- SteamDeck:1
- LOGNAME:deck
- USER:deck
Steam Deck: desktop mode:
- SteamOS: (env var unset)
- SteamGamepadUI: (env var unset)
- SteamDeck:1
- LOGNAME:deck
- USER:deck
“SteamDeck” is consistent in both modes and based on the name it seems like the most appropriate env var to check. This can be done with:
FPlatformMisc::GetEnvironmentVariable(TEXT("SteamDeck")).Equals(FString(TEXT("1")))
I hope this information is helpful!