mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-28 11:14:20 +01:00
- This makes to autmatically swittch to controller when Playnite Fullscreen is in use. - This makes to automatically disable when Steam is in Big Picture or running Game - Indicate current status with well distinguishable icons - Expose all options via Context Menu
36 lines
963 B
C#
36 lines
963 B
C#
using System.Diagnostics;
|
|
using SteamController.Helpers;
|
|
|
|
namespace SteamController.Profiles
|
|
{
|
|
public sealed class SteamDetectProfile : Profile
|
|
{
|
|
public override void Tick(Context context)
|
|
{
|
|
if (!Settings.Default.EnableSteamDetection)
|
|
{
|
|
context.DisableDueToSteam = false;
|
|
return;
|
|
}
|
|
|
|
var usesController = UsesController();
|
|
|
|
// if controller is used, disable due to Steam
|
|
context.DisableDueToSteam = usesController ?? true;
|
|
}
|
|
|
|
private bool? UsesController()
|
|
{
|
|
if (!SteamManager.IsRunning.GetValueOrDefault(false))
|
|
return null;
|
|
|
|
return SteamManager.IsBigPictureMode.GetValueOrDefault(false) || SteamManager.IsRunningGame.GetValueOrDefault(false);
|
|
}
|
|
|
|
public override Status Run(Context context)
|
|
{
|
|
return Status.Continue;
|
|
}
|
|
}
|
|
}
|