mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-02-13 19:14:23 +01:00
SteamController: Detect RTSS in foreground
This commit is contained in:
parent
e5debff45b
commit
312fc97034
|
|
@ -1,15 +1,9 @@
|
|||
using RTSSSharedMemoryNET;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PowerControl.Helpers
|
||||
namespace CommonHelpers
|
||||
{
|
||||
internal static class RTSS
|
||||
public static class RTSS
|
||||
{
|
||||
public static bool IsOSDForeground()
|
||||
{
|
||||
|
|
@ -22,12 +22,13 @@ namespace SteamController
|
|||
public struct ContextState
|
||||
{
|
||||
public bool GameProcessRunning { get; set; }
|
||||
public bool RTSSInForeground { get; set; }
|
||||
public bool SteamUsesX360Controller { get; set; }
|
||||
public bool SteamUsesSteamInput { get; set; }
|
||||
|
||||
public bool IsActive
|
||||
{
|
||||
get { return GameProcessRunning || SteamUsesSteamInput || SteamUsesSteamInput; }
|
||||
get { return RTSSInForeground || GameProcessRunning || SteamUsesSteamInput || SteamUsesSteamInput; }
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
|
@ -36,6 +37,7 @@ namespace SteamController
|
|||
if (GameProcessRunning) reason += " game";
|
||||
if (SteamUsesX360Controller) reason += " steamX360";
|
||||
if (SteamUsesSteamInput) reason += " steamInput";
|
||||
if (RTSSInForeground) reason += " rtss";
|
||||
return reason;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ namespace SteamController
|
|||
Managers = {
|
||||
new Managers.ProcessManager(),
|
||||
new Managers.SteamManager(),
|
||||
new Managers.RTSSManager(),
|
||||
new Managers.ProfileSwitcher(),
|
||||
new Managers.SteamConfigsManager(),
|
||||
new Managers.SharedDataManager(),
|
||||
|
|
|
|||
12
SteamController/Managers/RTSSManager.cs
Normal file
12
SteamController/Managers/RTSSManager.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using CommonHelpers;
|
||||
|
||||
namespace SteamController.Managers
|
||||
{
|
||||
public sealed class RTSSManager : Manager
|
||||
{
|
||||
public override void Tick(Context context)
|
||||
{
|
||||
context.State.RTSSInForeground = SettingsDebug.Default.DetectRTSSForeground && RTSS.IsOSDForeground();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -20,6 +20,13 @@ namespace SteamController
|
|||
set { Set("KeepX360AlwaysConnected", value); }
|
||||
}
|
||||
|
||||
[Description("If current foreground process uses overlay, treat it as a game.")]
|
||||
public bool DetectRTSSForeground
|
||||
{
|
||||
get { return Get<bool>("DetectRTSSForeground", false); }
|
||||
set { Set("DetectRTSSForeground", value); }
|
||||
}
|
||||
|
||||
[Description("Use Lizard Buttons instead of emulated. This option is only for testing purposes.")]
|
||||
public bool LizardButtons { get; set; } = false;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue