GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2023-02-25 08:30:24

FollowTheFun
Member
Registered: 2023-02-25
Posts: 1
Website

Check if running on steamdeck

My game got marked as 'not supported on steam deck' on my steam storepage, so I had to buy a steamdeck to get that fixed.

Now I have one, I use the following script to enter into 'deck mode' which basically just hides the cursor and uses device_mouse instead of mouse_check:

Expand///running_on_steamdeck()
/*
Returns true [boolean] if we're running on steamdeck

environment_get_variable("Steameck") returns "1" for steamdeck (string) and "" for not.

Special thanks to @YellowAfterlife for discovering you can do this. 

(Tested in gms1.4 windows export, not tested for gms2 or linux).
*/

return environment_get_variable("SteamDeck") == "1"; 

It works on the windows (both yyc and not) export (Steam deck uses Proton, which pretends to be windows 10). I have not tested this on linux or game maker 2. But it probably still works.


V5uhxmk.png

Offline

#2 2023-03-09 18:50:52

gnysek
Member
Registered: 2011-12-29
Posts: 36

Re: Check if running on steamdeck

For linux version, for sure this works:

Expandfunction is_deck(){
	var os = os_get_info();
	var _is_deck = false;
	if (os_type == os_linux) {
		if (ds_exists(os, ds_type_map)) {
			var _renderer_info = os[? "gl_renderer_string"];
			if ((_renderer_info != undefined) and string_pos("valve", _renderer_info) > 1 and string_pos("neptune", _renderer_info) > 1) {
				_is_deck = true;
			}
		}
	}
	ds_map_destroy(os);
	return _is_deck;
}

Last edited by gnysek (2023-03-09 18:51:38)

Offline

Board footer

Powered by FluxBB