mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: platform: sdl2: add expiremntal flag -nosteaminput that would remove set by Steam SDL environment variables and let us use gamepad directly
This commit is contained in:
@@ -118,6 +118,15 @@ void SDLash_Init( void )
|
||||
SDL_SetHint( SDL_HINT_ANDROID_BLOCK_ON_PAUSE, "0" );
|
||||
SDL_SetHint( SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO, "0" );
|
||||
|
||||
// when launched through Steam (notably on Steam Deck) Steam Input hides the
|
||||
// real controller and exposes a virtual gamepad without gyro/touchpad access
|
||||
// undo the env-var filter and ignore the virtual pad instead
|
||||
if( Sys_CheckParm( "-nosteaminput" ))
|
||||
{
|
||||
SDL_setenv( "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT", "", 1 );
|
||||
SDL_setenv( "SDL_GAMECONTROLLER_IGNORE_DEVICES", "0x28DE/0x11FF", 1 );
|
||||
}
|
||||
|
||||
if( SDL_Init( SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_EVENTS ) )
|
||||
{
|
||||
Sys_Warn( "SDL_Init failed: %s", SDL_GetError() );
|
||||
|
||||
Reference in New Issue
Block a user