diff --git a/SteamController/Context.cs b/SteamController/Context.cs index 621eea9..cabc28b 100644 --- a/SteamController/Context.cs +++ b/SteamController/Context.cs @@ -25,7 +25,6 @@ namespace SteamController public bool RequestDesktopMode { get; set; } = true; public bool SteamRunning { get; set; } = false; public bool SteamUsesController { get; set; } = false; - public bool ControllerHidden { get; set; } = false; public bool Enabled { diff --git a/SteamController/Controller.cs b/SteamController/Controller.cs index ff874e8..7724c23 100644 --- a/SteamController/Controller.cs +++ b/SteamController/Controller.cs @@ -55,17 +55,6 @@ namespace SteamController contextMenu.Opening += delegate { desktopModeItem.Checked = context.RequestDesktopMode; }; contextMenu.Items.Add(desktopModeItem); - var hidHideItem = new ToolStripMenuItem("Use &HidHide"); - hidHideItem.Checked = Settings.Default.EnableHidHide; - hidHideItem.Enabled = HidHideCLI.IsAvailable; - hidHideItem.Click += delegate - { - Settings.Default.EnableHidHide = !Settings.Default.EnableHidHide; - Settings.Default.Save(); - }; - contextMenu.Opening += delegate { hidHideItem.Checked = Settings.Default.EnableHidHide; }; - contextMenu.Items.Add(hidHideItem); - var steamDetectionItem = new ToolStripMenuItem("Auto-disable on &Steam"); steamDetectionItem.Checked = Settings.Default.EnableSteamDetection; steamDetectionItem.Click += delegate diff --git a/SteamController/Helpers/HidHideCLI.cs b/SteamController/Helpers/HidHideCLI.cs deleted file mode 100644 index b89822a..0000000 --- a/SteamController/Helpers/HidHideCLI.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using Microsoft.Win32; - -namespace SteamController.Helpers -{ - internal static class HidHideCLI - { - public const String CLIPath = @"C:\Program Files\Nefarius Software Solutions\HidHide\x64\HidHideCLI.exe"; - - static HidHideCLI() - { - IsAvailable = File.Exists(CLIPath); - } - - public static bool IsAvailable - { - get; private set; - } - - public static bool Cloak(bool enable = true) - { - if (enable) - return StartCLI("--cloak-on"); - else - return StartCLI("--cloak-off"); - } - - public static bool RegisterApplication(String path, bool seeHidden = true) - { - if (seeHidden) - return StartCLI("--app-reg", path); - else - return StartCLI("--app-unreg", path); - } - - public static bool HideDevice(String path, bool hide = true) - { - if (hide) - return StartCLI("--dev-hide", path); - else - return StartCLI("--dev-unhide", path); - } - - public static bool RegisterApplication(bool seeHidden) - { - var process = Process.GetCurrentProcess(); - var fullPath = process?.MainModule?.FileName; - if (fullPath is not null) - return RegisterApplication(fullPath, seeHidden); - - return true; - } - - private static bool StartCLI(params string[] args) - { - var si = new ProcessStartInfo() - { - FileName = CLIPath, - WindowStyle = ProcessWindowStyle.Hidden, - UseShellExecute = false, - CreateNoWindow = true - }; - - foreach (var arg in args) - { - si.ArgumentList.Add(arg); - } - - var process = Process.Start(si); - return process is not null; - } - } -} diff --git a/SteamController/Managers/HidHideManager.cs b/SteamController/Managers/HidHideManager.cs deleted file mode 100644 index f58071b..0000000 --- a/SteamController/Managers/HidHideManager.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Diagnostics; -using SteamController.Helpers; - -namespace SteamController.Managers -{ - public sealed class HidHideManager : Manager - { - public const String NeptuneDevicePath = @"HID\VID_28DE&PID_1205&MI_02\8&a5f3a41&0&0000"; - - private bool? applicationRegistered; - private bool? deviceHidden; - private bool? clockDevices; - - public override void Tick(Context context) - { - if (applicationRegistered != true) - { - HidHideCLI.RegisterApplication(true); - applicationRegistered = true; - } - - if (clockDevices != true) - { - HidHideCLI.Cloak(true); - clockDevices = true; - } - - if (!Settings.Default.EnableHidHide) - { - HideDevice(false); - return; - } - - if (context.SteamUsesController) - { - HideDevice(false); - context.ControllerHidden = false; - } - else - { - HideDevice(true); - context.ControllerHidden = true; - } - } - - private void HideDevice(bool hidden) - { - if (deviceHidden == hidden) - return; - - HidHideCLI.HideDevice(NeptuneDevicePath, hidden); - deviceHidden = hidden; - } - } -}