From 913e8e5f3c4b5782904b4d922219e4770cc31bf5 Mon Sep 17 00:00:00 2001 From: Lesueur Benjamin Date: Thu, 14 Mar 2024 08:54:40 +0100 Subject: [PATCH] Implement Legion Go per-controller-gyro support (#204) * Testing left gyro * start implementing per-controller gyro support * improve the automatic sensor switching logic - when a controller is targeted, use its sensors if available - when unplugged, if controller had sensors, pick next available - if a controller is plugged and doesn't have sensors, pick next available * implement LegionControllerGyroIndex on DevicePage * fix type on gZ --- HandheldCompanion/App.config | 545 ++++----- .../Controllers/LegionController.cs | 101 +- HandheldCompanion/Devices/Lenovo/LegionGo.cs | 17 +- .../Devices/Lenovo/SapientiaUsb.cs | 2 +- .../Managers/ControllerManager.cs | 24 +- HandheldCompanion/Managers/HotkeysManager.cs | 2 +- HandheldCompanion/Managers/SensorsManager.cs | 26 +- .../Properties/Settings.Designer.cs | 1070 +++++++---------- .../Properties/Settings.settings | 30 + .../Views/Pages/ControllerPage.xaml.cs | 14 +- HandheldCompanion/Views/Pages/DevicePage.xaml | 80 ++ .../Views/Pages/DevicePage.xaml.cs | 22 + 12 files changed, 933 insertions(+), 1000 deletions(-) diff --git a/HandheldCompanion/App.config b/HandheldCompanion/App.config index a6c1d1472..ea88d8c68 100644 --- a/HandheldCompanion/App.config +++ b/HandheldCompanion/App.config @@ -11,276 +11,279 @@ - - False - - - False - - - False - - - False - - - 720 - - - 1280 - - - 0 - - - 0 - - - 2 - - - 0 - - - 1989-12-20 - - - 0 - - - 7 - - - 300 - - - 1 - - - 0.25 - - - 250 - - - en-US - - - 0 - - - 0 - - - 0 - - - False - - - -1 - - - 0 - - - 30 - - - False - - - True - - - 720 - - - False - - - 0 - - - 0 - - - 1 - - - #00000000 - - - 0 - - - True - - - 1 - - - False - - - https://api.github.com/repos/Valkirie/HandheldCompanion - - - True - - - True - - - 100 - - - - - - True - - - False - - - True - - - False - - - False - - - True - - - 40 - - - False - - - False - - - True - - - False - - - False - - - 0 - - - 1000 - - - -1 - - - True - - - 3 - - - 1 - - - False - - - True - - - False - - - 0 - - - 1 - - - True - - - 26760 - - - 127.0.0.1 - - - 50 - - - #FFFFFF00 - - - False - - - False - - - 0 - - - True - - - #FFFFFF00 - - - False - - - 50 - - - False - - - False - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - Time,GPU,CPU,VRAM,RAM,BATT,FPS - - - False - - + + False + + + False + + + False + + + False + + + 720 + + + 1280 + + + 0 + + + 0 + + + 2 + + + 0 + + + 1989-12-20 + + + 0 + + + 7 + + + 300 + + + 1 + + + 0.25 + + + 250 + + + en-US + + + 0 + + + 0 + + + 0 + + + False + + + -1 + + + 0 + + + 30 + + + False + + + True + + + 720 + + + False + + + 0 + + + 0 + + + 1 + + + #00000000 + + + 0 + + + True + + + 1 + + + False + + + https://api.github.com/repos/Valkirie/HandheldCompanion + + + True + + + True + + + 100 + + + + + + True + + + False + + + True + + + False + + + False + + + True + + + 40 + + + False + + + False + + + True + + + False + + + False + + + 0 + + + 1000 + + + -1 + + + True + + + 3 + + + 1 + + + False + + + True + + + False + + + 0 + + + 1 + + + True + + + 26760 + + + 127.0.0.1 + + + 50 + + + #FFFFFF00 + + + False + + + False + + + 0 + + + True + + + #FFFFFF00 + + + False + + + 50 + + + False + + + False + + + 2 + + + False + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + Time,GPU,CPU,VRAM,RAM,BATT,FPS + + + 0 + + \ No newline at end of file diff --git a/HandheldCompanion/Controllers/LegionController.cs b/HandheldCompanion/Controllers/LegionController.cs index 90b1660b8..b7c6fd6b2 100644 --- a/HandheldCompanion/Controllers/LegionController.cs +++ b/HandheldCompanion/Controllers/LegionController.cs @@ -78,28 +78,30 @@ public override bool IsWireless } } - // Define some constants for the touchpad logic private bool IsPassthrough = false; - private uint LongPressTime = 1000; // The minimum time in milliseconds for a long press - private const int MaxDistance = 40; // Maximum distance tolerance between touch and untouch in pixels - - // Variables to store the touchpad state - private bool touchpadTouched = false; // Whether the touchpad is currently touched - private Vector2 touchpadPosition = Vector2.Zero; // The current position of the touchpad - private Vector2 touchpadFirstPosition = Vector2.Zero; // The first position of the touchpad when touched - private long touchpadStartTime = 0; // The start time of the touchpad when touched - private long touchpadEndTime = 0; // The end time of the touchpad when untouched - private bool touchpadDoubleTapped = false; // Whether the touchpad has been double tapped - private bool touchpadLongTapped = false; // Whether the touchpad has been long tapped - + private int GyroIndex = LegionGo.RightJoyconIndex; + + private uint LongPressTime = 1000; // The minimum time in milliseconds for a long press + private const int MaxDistance = 40; // Maximum distance tolerance between touch and untouch in pixels + private bool touchpadTouched = false; // Whether the touchpad is currently touched + private Vector2 touchpadPosition = Vector2.Zero; // The current position of the touchpad + private Vector2 touchpadFirstPosition = Vector2.Zero; // The first position of the touchpad when touched + private long touchpadStartTime = 0; // The start time of the touchpad when touched + private long touchpadEndTime = 0; // The end time of the touchpad when untouched + private bool touchpadDoubleTapped = false; // Whether the touchpad has been double tapped + private bool touchpadLongTapped = false; // Whether the touchpad has been long tapped private long lastTap = 0; - private Vector2 lastTapPosition = Vector2.Zero; // The current position of the touchpad + private Vector2 lastTapPosition = Vector2.Zero; // The current position of the touchpad + + public LegionController() : base() { } public LegionController(PnPDetails details) : base(details) - { + { + Capabilities |= ControllerCapabilities.MotionSensor; + // get long press time from system settings SystemParametersInfo(0x006A, 0, ref LongPressTime, 0); @@ -134,6 +136,7 @@ protected override void InitializeInputOutput() protected override void UpdateSettings() { SetPassthrough(SettingsManager.GetBoolean("LegionControllerPassthrough")); + SetGyroIndex(SettingsManager.GetInt("LegionControllerGyroIndex")); } private void SettingsManager_SettingValueChanged(string name, object value) @@ -143,6 +146,9 @@ private void SettingsManager_SettingValueChanged(string name, object value) case "LegionControllerPassthrough": SetPassthrough(Convert.ToBoolean(value)); break; + case "LegionControllerGyroIndex": + SetGyroIndex(Convert.ToInt32(value)); + break; } } @@ -259,15 +265,62 @@ public override void UpdateInputs(long ticks, bool commit) // handle touchpad if passthrough is off if (!IsPassthrough) - HandleTouchpadInput(touched, TouchpadX, TouchpadY); - + HandleTouchpadInput(touched, TouchpadX, TouchpadY); + /* Inputs.AxisState[AxisFlags.LeftStickX] += (short)InputUtils.MapRange(Data[29], byte.MinValue, byte.MaxValue, short.MinValue, short.MaxValue); Inputs.AxisState[AxisFlags.LeftStickY] -= (short)InputUtils.MapRange(Data[30], byte.MinValue, byte.MaxValue, short.MinValue, short.MaxValue); Inputs.AxisState[AxisFlags.RightStickX] += (short)InputUtils.MapRange(Data[31], byte.MinValue, byte.MaxValue, short.MinValue, short.MaxValue); Inputs.AxisState[AxisFlags.RightStickY] -= (short)InputUtils.MapRange(Data[32], byte.MinValue, byte.MaxValue, short.MinValue, short.MaxValue); - */ + */ + + short aX, aZ, aY = 0; + short gX, gZ, gY = 0; + + switch (GyroIndex) + { + default: + case LegionGo.LeftJoyconIndex: + { + aX = (short)(Data[34] << 8 | Data[35]); + aZ = (short)(Data[36] << 8 | Data[37]); + aY = (short)(Data[38] << 8 | Data[39]); + + Inputs.GyroState.Accelerometer.X = aX * (2.0f / short.MaxValue); + Inputs.GyroState.Accelerometer.Y = aY * (2.0f / short.MaxValue); + Inputs.GyroState.Accelerometer.Z = aZ * -(2.0f / short.MaxValue); + + gX = (short)(Data[40] << 8 | Data[41]); + gZ = (short)(Data[42] << 8 | Data[43]); + gY = (short)(Data[44] << 8 | Data[45]); + + Inputs.GyroState.Gyroscope.X = gX * -(2048.0f / short.MaxValue); + Inputs.GyroState.Gyroscope.Y = gY * (2048.0f / short.MaxValue); + Inputs.GyroState.Gyroscope.Z = gZ * -(2048.0f / short.MaxValue); + } + break; + + case LegionGo.RightJoyconIndex: + { + aX = (short)(Data[49] << 8 | Data[50]); + aZ = (short)(Data[47] << 8 | Data[48]); + aY = (short)(Data[51] << 8 | Data[52]); + + Inputs.GyroState.Accelerometer.X = aX * (2.0f / short.MaxValue); + Inputs.GyroState.Accelerometer.Y = aY * (2.0f / short.MaxValue); + Inputs.GyroState.Accelerometer.Z = aZ * (2.0f / short.MaxValue); + + gX = (short)(Data[55] << 8 | Data[56]); + gZ = (short)(Data[53] << 8 | Data[54]); + gY = (short)(Data[57] << 8 | Data[58]); + + Inputs.GyroState.Gyroscope.X = gX * -(2048.0f / short.MaxValue); + Inputs.GyroState.Gyroscope.Y = gY * (2048.0f / short.MaxValue); + Inputs.GyroState.Gyroscope.Z = gZ * (2048.0f / short.MaxValue); + } + break; + } base.UpdateInputs(ticks); } @@ -284,10 +337,8 @@ private async void dataThreadLoop(object? obj) if (report is not null) { // check if packet is safe - if (READY_STATES.Contains(report.Data[STATUS_IDX])) - { - Data = report.Data; - } + if (READY_STATES.Contains(report.Data[STATUS_IDX])) + Data = report.Data; } } } @@ -420,11 +471,15 @@ public void HandleTouchpadInput(bool touched, ushort x, ushort y) } } - internal void SetPassthrough(bool enabled) + public void SetPassthrough(bool enabled) { SetTouchPadStatus(enabled ? 1 : 0); IsPassthrough = enabled; } + public void SetGyroIndex(int idx) + { + GyroIndex = idx + LegionGo.LeftJoyconIndex; + } } } diff --git a/HandheldCompanion/Devices/Lenovo/LegionGo.cs b/HandheldCompanion/Devices/Lenovo/LegionGo.cs index 5b3af31aa..f2ffcecc3 100644 --- a/HandheldCompanion/Devices/Lenovo/LegionGo.cs +++ b/HandheldCompanion/Devices/Lenovo/LegionGo.cs @@ -100,8 +100,8 @@ private Task SetCPUPowerLimit(CapabilityID capabilityID, int limit) => public override bool IsOpen => hidDevices.ContainsKey(INPUT_HID_ID) && hidDevices[INPUT_HID_ID].IsOpen; - public static int LeftJoyconIndex = 3; - public static int RightJoyconIndex = 4; + public const int LeftJoyconIndex = 3; + public const int RightJoyconIndex = 4; public LegionGo() { @@ -208,6 +208,18 @@ public LegionGo() Init(); + // make sure both left and right gyros are enabled + SetLeftGyroStatus(1); + SetRightGyroStatus(1); + + // make sure both left and right gyros are reporting values + SetGyroModeStatus(2, 1, 1); + SetGyroModeStatus(2, 2, 2); + + // make sure both left and right gyros are reporting raw values + SetGyroSensorDataOnorOff(LeftJoyconIndex, 0x02); + SetGyroSensorDataOnorOff(RightJoyconIndex, 0x02); + Task task = Task.Run(async () => await GetFanFullSpeedAsync()); bool FanFullSpeed = task.Result; } @@ -253,6 +265,7 @@ public override bool Open() SetQuickLightingEffect(0, 1); SetQuickLightingEffect(3, 1); SetQuickLightingEffect(4, 1); + SetQuickLightingEffectEnable(0, false); SetQuickLightingEffectEnable(3, false); SetQuickLightingEffectEnable(4, false); diff --git a/HandheldCompanion/Devices/Lenovo/SapientiaUsb.cs b/HandheldCompanion/Devices/Lenovo/SapientiaUsb.cs index 58dba2661..df64d93bb 100644 --- a/HandheldCompanion/Devices/Lenovo/SapientiaUsb.cs +++ b/HandheldCompanion/Devices/Lenovo/SapientiaUsb.cs @@ -177,7 +177,7 @@ public VERSION(int verPro, int verCMD, int verFir, int verHard) public static extern bool SetStickCustomDeadzone(int device, int deadzone); [DllImport("SapientiaUsb.dll", CallingConvention = CallingConvention.StdCall)] - public static extern bool GetGyroSensorDataOnorOff(int device); + public static extern bool SetGyroSensorDataOnorOff(int device, int status); // Range is 0-99 on Deadzone and Margin [DllImport("SapientiaUsb.dll", CallingConvention = CallingConvention.StdCall)] diff --git a/HandheldCompanion/Managers/ControllerManager.cs b/HandheldCompanion/Managers/ControllerManager.cs index ee653557e..01cedf821 100644 --- a/HandheldCompanion/Managers/ControllerManager.cs +++ b/HandheldCompanion/Managers/ControllerManager.cs @@ -190,15 +190,13 @@ private static void ProcessManager_ForegroundChanged(ProcessEx processEx, Proces private static void CurrentDevice_KeyReleased(ButtonFlags button) { // calls current controller (if connected) - var controller = GetTargetController(); - controller?.InjectButton(button, false, true); + targetController?.InjectButton(button, false, true); } private static void CurrentDevice_KeyPressed(ButtonFlags button) { // calls current controller (if connected) - var controller = GetTargetController(); - controller?.InjectButton(button, true, false); + targetController?.InjectButton(button, true, false); } private static void CheckControllerScenario() @@ -580,13 +578,16 @@ private static async void HidDeviceRemoved(PnPDetails details, DeviceEventArgs o // are we power cycling ? PowerCyclers.TryGetValue(details.baseContainerDeviceInstanceId, out bool IsPowerCycling); + // is controller current target ? + bool WasTarget = targetController?.GetContainerInstancePath() == details.baseContainerDeviceInstanceId; + // unhide on remove if (!IsPowerCycling) { controller.Unhide(false); // unplug controller, if needed - if (GetTargetController()?.GetContainerInstancePath() == details.baseContainerDeviceInstanceId) + if (WasTarget) ClearTargetController(); else controller.Unplug(); @@ -598,7 +599,7 @@ private static async void HidDeviceRemoved(PnPDetails details, DeviceEventArgs o LogManager.LogDebug("Generic controller {0} unplugged", controller.ToString()); // raise event - ControllerUnplugged?.Invoke(controller, IsPowerCycling); + ControllerUnplugged?.Invoke(controller, IsPowerCycling, WasTarget); } private static void watchdogThreadLoop(object? obj) @@ -846,6 +847,9 @@ private static async void XUsbDeviceRemoved(PnPDetails details, DeviceEventArgs // are we power cycling ? PowerCyclers.TryGetValue(details.baseContainerDeviceInstanceId, out bool IsPowerCycling); + // is controller current target ? + bool WasTarget = targetController?.GetContainerInstancePath() == details.baseContainerDeviceInstanceId; + // controller was unplugged if (!IsPowerCycling) { @@ -853,7 +857,7 @@ private static async void XUsbDeviceRemoved(PnPDetails details, DeviceEventArgs Controllers.TryRemove(details.baseContainerDeviceInstanceId, out _); // controller is current target - if (targetController?.GetContainerInstancePath() == details.baseContainerDeviceInstanceId) + if (WasTarget) ClearTargetController(); else controller.Unplug(); @@ -862,7 +866,7 @@ private static async void XUsbDeviceRemoved(PnPDetails details, DeviceEventArgs LogManager.LogDebug("XInput controller {0} unplugged", controller.ToString()); // raise event - ControllerUnplugged?.Invoke(controller, IsPowerCycling); + ControllerUnplugged?.Invoke(controller, IsPowerCycling, WasTarget); } private static object targetLock = new object(); @@ -1087,6 +1091,8 @@ private static void UpdateInputs(ControllerState controllerState) case SensorFamily.SerialUSBIMU: SensorsManager.UpdateReport(controllerState); break; + default: + break; } // pass to MotionManager for calculations @@ -1141,7 +1147,7 @@ internal static IController GetEmulatedController() public delegate void ControllerPluggedEventHandler(IController Controller, bool IsPowerCycling); public static event ControllerUnpluggedEventHandler ControllerUnplugged; - public delegate void ControllerUnpluggedEventHandler(IController Controller, bool IsPowerCycling); + public delegate void ControllerUnpluggedEventHandler(IController Controller, bool IsPowerCycling, bool WasTarget); public static event ControllerSelectedEventHandler ControllerSelected; public delegate void ControllerSelectedEventHandler(IController Controller); diff --git a/HandheldCompanion/Managers/HotkeysManager.cs b/HandheldCompanion/Managers/HotkeysManager.cs index 54f489d47..4ee26d61c 100644 --- a/HandheldCompanion/Managers/HotkeysManager.cs +++ b/HandheldCompanion/Managers/HotkeysManager.cs @@ -87,7 +87,7 @@ private static void ControllerManager_ControllerPlugged(IController Controller, } } - private static void ControllerManager_ControllerUnplugged(IController Controller, bool IsPowerCycling) + private static void ControllerManager_ControllerUnplugged(IController Controller, bool IsPowerCycling, bool WasTarget) { // when the target emulated controller is Xbox Controller // only enable HIDmode switch hotkey when controller is unplugged (last stage of HIDmode change in this case) diff --git a/HandheldCompanion/Managers/SensorsManager.cs b/HandheldCompanion/Managers/SensorsManager.cs index 9d84d85fa..565f943d3 100644 --- a/HandheldCompanion/Managers/SensorsManager.cs +++ b/HandheldCompanion/Managers/SensorsManager.cs @@ -35,43 +35,45 @@ static SensorsManager() private static void ControllerManager_ControllerSelected(IController Controller) { // select controller as current sensor if current sensor selection is none - if (sensorFamily == SensorFamily.None && Controller.Capabilities.HasFlag(ControllerCapabilities.MotionSensor)) + if (Controller.Capabilities.HasFlag(ControllerCapabilities.MotionSensor)) SettingsManager.SetProperty("SensorSelection", (int)SensorFamily.Controller); + else + PickNextSensor(); } - private static void ControllerManager_ControllerUnplugged(IController Controller, bool IsPowerCycling) + private static void ControllerManager_ControllerUnplugged(IController Controller, bool IsPowerCycling, bool WasTarget) { if (sensorFamily != SensorFamily.Controller) return; // skip if controller isn't current or doesn't have motion sensor anyway - if (!Controller.HasMotionSensor() || Controller != ControllerManager.GetTargetController()) + if (!Controller.HasMotionSensor() || !WasTarget) return; - - if (sensorFamily == SensorFamily.Controller) - PickNextSensor(); + + // pick next available sensor + PickNextSensor(); } private static void DeviceManager_UsbDeviceRemoved(PnPDevice device, DeviceEventArgs obj) { - if (USBSensor is null) + if (USBSensor is null || sensorFamily != SensorFamily.SerialUSBIMU) return; // If the USB Gyro is unplugged, close serial connection USBSensor.Close(); - if (sensorFamily == SensorFamily.SerialUSBIMU) - PickNextSensor(); + // pick next available sensor + PickNextSensor(); } private static void PickNextSensor() { - if (MainWindow.CurrentDevice.Capabilities.HasFlag(DeviceCapabilities.InternalSensor)) + if (ControllerManager.GetTargetController() is not null && ControllerManager.GetTargetController().HasMotionSensor()) + SettingsManager.SetProperty("SensorSelection", (int)SensorFamily.Controller); + else if (MainWindow.CurrentDevice.Capabilities.HasFlag(DeviceCapabilities.InternalSensor)) SettingsManager.SetProperty("SensorSelection", (int)SensorFamily.Windows); else if (MainWindow.CurrentDevice.Capabilities.HasFlag(DeviceCapabilities.ExternalSensor)) SettingsManager.SetProperty("SensorSelection", (int)SensorFamily.SerialUSBIMU); - else if (ControllerManager.GetTargetController() is not null && ControllerManager.GetTargetController().HasMotionSensor()) - SettingsManager.SetProperty("SensorSelection", (int)SensorFamily.Controller); else SettingsManager.SetProperty("SensorSelection", (int)SensorFamily.None); } diff --git a/HandheldCompanion/Properties/Settings.Designer.cs b/HandheldCompanion/Properties/Settings.Designer.cs index 65be89609..a52c3cb3b 100644 --- a/HandheldCompanion/Properties/Settings.Designer.cs +++ b/HandheldCompanion/Properties/Settings.Designer.cs @@ -17,1390 +17,1124 @@ namespace HandheldCompanion.Properties internal sealed partial class Settings : ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool ToastEnable - { - get - { + public bool ToastEnable { + get { return ((bool)(this["ToastEnable"])); } - set - { + set { this["ToastEnable"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool RunAtStartup - { - get - { + public bool RunAtStartup { + get { return ((bool)(this["RunAtStartup"])); } - set - { + set { this["RunAtStartup"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool StartMinimized - { - get - { + public bool StartMinimized { + get { return ((bool)(this["StartMinimized"])); } - set - { + set { this["StartMinimized"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool CloseMinimises - { - get - { + public bool CloseMinimises { + get { return ((bool)(this["CloseMinimises"])); } - set - { + set { this["CloseMinimises"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("720")] - public double MainWindowHeight - { - get - { + public double MainWindowHeight { + get { return ((double)(this["MainWindowHeight"])); } - set - { + set { this["MainWindowHeight"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("1280")] - public double MainWindowWidth - { - get - { + public double MainWindowWidth { + get { return ((double)(this["MainWindowWidth"])); } - set - { + set { this["MainWindowWidth"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public double MainWindowLeft - { - get - { + public double MainWindowLeft { + get { return ((double)(this["MainWindowLeft"])); } - set - { + set { this["MainWindowLeft"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public double MainWindowTop - { - get - { + public double MainWindowTop { + get { return ((double)(this["MainWindowTop"])); } - set - { + set { this["MainWindowTop"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("2")] - public int MainWindowState - { - get - { + public int MainWindowState { + get { return ((int)(this["MainWindowState"])); } - set - { + set { this["MainWindowState"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int MainWindowTheme - { - get - { + public int MainWindowTheme { + get { return ((int)(this["MainWindowTheme"])); } - set - { + set { this["MainWindowTheme"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("1989-12-20")] - public global::System.DateTime UpdateLastChecked - { - get - { + public global::System.DateTime UpdateLastChecked { + get { return ((global::System.DateTime)(this["UpdateLastChecked"])); } - set - { + set { this["UpdateLastChecked"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int OverlayModel - { - get - { + public int OverlayModel { + get { return ((int)(this["OverlayModel"])); } - set - { + set { this["OverlayModel"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("7")] - public int OverlayControllerAlignment - { - get - { + public int OverlayControllerAlignment { + get { return ((int)(this["OverlayControllerAlignment"])); } - set - { + set { this["OverlayControllerAlignment"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("300")] - public double OverlayControllerSize - { - get - { + public double OverlayControllerSize { + get { return ((double)(this["OverlayControllerSize"])); } - set - { + set { this["OverlayControllerSize"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("1")] - public int OverlayTrackpadsAlignment - { - get - { + public int OverlayTrackpadsAlignment { + get { return ((int)(this["OverlayTrackpadsAlignment"])); } - set - { + set { this["OverlayTrackpadsAlignment"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0.25")] - public double OverlayTrackpadsOpacity - { - get - { + public double OverlayTrackpadsOpacity { + get { return ((double)(this["OverlayTrackpadsOpacity"])); } - set - { + set { this["OverlayTrackpadsOpacity"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("250")] - public double OverlayTrackpadsSize - { - get - { + public double OverlayTrackpadsSize { + get { return ((double)(this["OverlayTrackpadsSize"])); } - set - { + set { this["OverlayTrackpadsSize"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("en-US")] - public string CurrentCulture - { - get - { + public string CurrentCulture { + get { return ((string)(this["CurrentCulture"])); } - set - { + set { this["CurrentCulture"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public double OverlayControllerRestingPitch - { - get - { + public double OverlayControllerRestingPitch { + get { return ((double)(this["OverlayControllerRestingPitch"])); } - set - { + set { this["OverlayControllerRestingPitch"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public double OverlayControllerRestingYaw - { - get - { + public double OverlayControllerRestingYaw { + get { return ((double)(this["OverlayControllerRestingYaw"])); } - set - { + set { this["OverlayControllerRestingYaw"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public double OverlayControllerRestingRoll - { - get - { + public double OverlayControllerRestingRoll { + get { return ((double)(this["OverlayControllerRestingRoll"])); } - set - { + set { this["OverlayControllerRestingRoll"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool SensorPlacementUpsideDown - { - get - { + public bool SensorPlacementUpsideDown { + get { return ((bool)(this["SensorPlacementUpsideDown"])); } - set - { + set { this["SensorPlacementUpsideDown"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("-1")] - public int SensorSelection - { - get - { + public int SensorSelection { + get { return ((int)(this["SensorSelection"])); } - set - { + set { this["SensorSelection"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int SensorPlacement - { - get - { + public int SensorPlacement { + get { return ((int)(this["SensorPlacement"])); } - set - { + set { this["SensorPlacement"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("30")] - public double OverlayRenderInterval - { - get - { + public double OverlayRenderInterval { + get { return ((double)(this["OverlayRenderInterval"])); } - set - { + set { this["OverlayRenderInterval"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool OverlayRenderAntialiasing - { - get - { + public bool OverlayRenderAntialiasing { + get { return ((bool)(this["OverlayRenderAntialiasing"])); } - set - { + set { this["OverlayRenderAntialiasing"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool OverlayFaceCamera - { - get - { + public bool OverlayFaceCamera { + get { return ((bool)(this["OverlayFaceCamera"])); } - set - { + set { this["OverlayFaceCamera"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("720")] - public double QuickToolsHeight - { - get - { + public double QuickToolsHeight { + get { return ((double)(this["QuickToolsHeight"])); } - set - { + set { this["QuickToolsHeight"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool ConfigurableTDPOverride - { - get - { + public bool ConfigurableTDPOverride { + get { return ((bool)(this["ConfigurableTDPOverride"])); } - set - { + set { this["ConfigurableTDPOverride"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public double ConfigurableTDPOverrideUp - { - get - { + public double ConfigurableTDPOverrideUp { + get { return ((double)(this["ConfigurableTDPOverrideUp"])); } - set - { + set { this["ConfigurableTDPOverrideUp"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public double ConfigurableTDPOverrideDown - { - get - { + public double ConfigurableTDPOverrideDown { + get { return ((double)(this["ConfigurableTDPOverrideDown"])); } - set - { + set { this["ConfigurableTDPOverrideDown"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("1")] - public double OverlayControllerOpacity - { - get - { + public double OverlayControllerOpacity { + get { return ((double)(this["OverlayControllerOpacity"])); } - set - { + set { this["OverlayControllerOpacity"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("#00000000")] - public string OverlayControllerBackgroundColor - { - get - { + public string OverlayControllerBackgroundColor { + get { return ((string)(this["OverlayControllerBackgroundColor"])); } - set - { + set { this["OverlayControllerBackgroundColor"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int MainWindowPrevState - { - get - { + public int MainWindowPrevState { + get { return ((int)(this["MainWindowPrevState"])); } - set - { + set { this["MainWindowPrevState"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool FirstStart - { - get - { + public bool FirstStart { + get { return ((bool)(this["FirstStart"])); } - set - { + set { this["FirstStart"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("1")] - public int MainWindowBackdrop - { - get - { + public int MainWindowBackdrop { + get { return ((int)(this["MainWindowBackdrop"])); } - set - { + set { this["MainWindowBackdrop"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool UseEnergyStar - { - get - { + public bool UseEnergyStar { + get { return ((bool)(this["UseEnergyStar"])); } - set - { + set { this["UseEnergyStar"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("https://api.github.com/repos/Valkirie/HandheldCompanion")] - public string UpdateUrl - { - get - { + public string UpdateUrl { + get { return ((string)(this["UpdateUrl"])); } - set - { + set { this["UpdateUrl"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool OverlayControllerAlwaysOnTop - { - get - { + public bool OverlayControllerAlwaysOnTop { + get { return ((bool)(this["OverlayControllerAlwaysOnTop"])); } - set - { + set { this["OverlayControllerAlwaysOnTop"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool HIDuncloakonclose - { - get - { + public bool HIDuncloakonclose { + get { return ((bool)(this["HIDuncloakonclose"])); } - set - { + set { this["HIDuncloakonclose"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("100")] - public double VibrationStrength - { - get - { + public double VibrationStrength { + get { return ((double)(this["VibrationStrength"])); } - set - { + set { this["VibrationStrength"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] - public string HIDInstancePath - { - get - { + public string HIDInstancePath { + get { return ((string)(this["HIDInstancePath"])); } - set - { + set { this["HIDInstancePath"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool OverlayControllerMotion - { - get - { + public bool OverlayControllerMotion { + get { return ((bool)(this["OverlayControllerMotion"])); } - set - { + set { this["OverlayControllerMotion"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool SteamControllerMute - { - get - { + public bool SteamControllerMute { + get { return ((bool)(this["SteamControllerMute"])); } - set - { + set { this["SteamControllerMute"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool HIDcloakonconnect - { - get - { + public bool HIDcloakonconnect { + get { return ((bool)(this["HIDcloakonconnect"])); } - set - { + set { this["HIDcloakonconnect"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool HIDvibrateonconnect - { - get - { + public bool HIDvibrateonconnect { + get { return ((bool)(this["HIDvibrateonconnect"])); } - set - { + set { this["HIDvibrateonconnect"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool QuickToolsIsPaneOpen - { - get - { + public bool QuickToolsIsPaneOpen { + get { return ((bool)(this["QuickToolsIsPaneOpen"])); } - set - { + set { this["QuickToolsIsPaneOpen"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool LayoutFilterOnDevice - { - get - { + public bool LayoutFilterOnDevice { + get { return ((bool)(this["LayoutFilterOnDevice"])); } - set - { + set { this["LayoutFilterOnDevice"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("40")] - public double QuietModeDuty - { - get - { + public double QuietModeDuty { + get { return ((double)(this["QuietModeDuty"])); } - set - { + set { this["QuietModeDuty"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool QuietModeToggled - { - get - { + public bool QuietModeToggled { + get { return ((bool)(this["QuietModeToggled"])); } - set - { + set { this["QuietModeToggled"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool QuietModeEnabled - { - get - { + public bool QuietModeEnabled { + get { return ((bool)(this["QuietModeEnabled"])); } - set - { + set { this["QuietModeEnabled"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool MainWindowIsPaneOpen - { - get - { + public bool MainWindowIsPaneOpen { + get { return ((bool)(this["MainWindowIsPaneOpen"])); } - set - { + set { this["MainWindowIsPaneOpen"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool DesktopProfileOnStart - { - get - { + public bool DesktopProfileOnStart { + get { return ((bool)(this["DesktopProfileOnStart"])); } - set - { + set { this["DesktopProfileOnStart"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool QuietModeDisclosure - { - get - { + public bool QuietModeDisclosure { + get { return ((bool)(this["QuietModeDisclosure"])); } - set - { + set { this["QuietModeDisclosure"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int OnScreenDisplayLevel - { - get - { + public int OnScreenDisplayLevel { + get { return ((int)(this["OnScreenDisplayLevel"])); } - set - { + set { this["OnScreenDisplayLevel"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("1000")] - public double OnScreenDisplayRefreshRate - { - get - { + public double OnScreenDisplayRefreshRate { + get { return ((double)(this["OnScreenDisplayRefreshRate"])); } - set - { + set { this["OnScreenDisplayRefreshRate"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("-1")] - public int NativeDisplayOrientation - { - get - { + public int NativeDisplayOrientation { + get { return ((int)(this["NativeDisplayOrientation"])); } - set - { + set { this["NativeDisplayOrientation"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool PlatformRTSSEnabled - { - get - { + public bool PlatformRTSSEnabled { + get { return ((bool)(this["PlatformRTSSEnabled"])); } - set - { + set { this["PlatformRTSSEnabled"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("3")] - public int QuickToolsLocation - { - get - { + public int QuickToolsLocation { + get { return ((int)(this["QuickToolsLocation"])); } - set - { + set { this["QuickToolsLocation"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("1")] - public int QuicktoolsBackdrop - { - get - { + public int QuicktoolsBackdrop { + get { return ((int)(this["QuicktoolsBackdrop"])); } - set - { + set { this["QuicktoolsBackdrop"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool QuickToolsAutoHide - { - get - { + public bool QuickToolsAutoHide { + get { return ((bool)(this["QuickToolsAutoHide"])); } - set - { + set { this["QuickToolsAutoHide"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool ControllerManagement - { - get - { + public bool ControllerManagement { + get { return ((bool)(this["ControllerManagement"])); } - set - { + set { this["ControllerManagement"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public global::System.Collections.Specialized.StringCollection SuspendedControllers - { - get - { + public global::System.Collections.Specialized.StringCollection SuspendedControllers { + get { return ((global::System.Collections.Specialized.StringCollection)(this["SuspendedControllers"])); } - set - { + set { this["SuspendedControllers"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool HidModeDoNotShowAgain - { - get - { + public bool HidModeDoNotShowAgain { + get { return ((bool)(this["HidModeDoNotShowAgain"])); } - set - { + set { this["HidModeDoNotShowAgain"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int HIDmode - { - get - { + public int HIDmode { + get { return ((int)(this["HIDmode"])); } - set - { + set { this["HIDmode"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("1")] - public int HIDstatus - { - get - { + public int HIDstatus { + get { return ((int)(this["HIDstatus"])); } - set - { + set { this["HIDstatus"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool DSUEnabled - { - get - { + public bool DSUEnabled { + get { return ((bool)(this["DSUEnabled"])); } - set - { + set { this["DSUEnabled"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("26760")] - public int DSUport - { - get - { + public int DSUport { + get { return ((int)(this["DSUport"])); } - set - { + set { this["DSUport"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("127.0.0.1")] - public string DSUip - { - get - { + public string DSUip { + get { return ((string)(this["DSUip"])); } - set - { + set { this["DSUip"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("50")] - public double LEDBrightness - { - get - { + public double LEDBrightness { + get { return ((double)(this["LEDBrightness"])); } - set - { + set { this["LEDBrightness"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("#FFFFFF00")] - public string LEDMainColor - { - get - { + public string LEDMainColor { + get { return ((string)(this["LEDMainColor"])); } - set - { + set { this["LEDMainColor"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool LEDAmbilightVerticalBlackBarDetection - { - get - { + public bool LEDAmbilightVerticalBlackBarDetection { + get { return ((bool)(this["LEDAmbilightVerticalBlackBarDetection"])); } - set - { + set { this["LEDAmbilightVerticalBlackBarDetection"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool LEDUseSecondColor - { - get - { + public bool LEDUseSecondColor { + get { return ((bool)(this["LEDUseSecondColor"])); } - set - { + set { this["LEDUseSecondColor"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int LEDSettingsLevel - { - get - { + public int LEDSettingsLevel { + get { return ((int)(this["LEDSettingsLevel"])); } - set - { + set { this["LEDSettingsLevel"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool LEDSettingsEnabled - { - get - { + public bool LEDSettingsEnabled { + get { return ((bool)(this["LEDSettingsEnabled"])); } - set - { + set { this["LEDSettingsEnabled"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("#FFFFFF00")] - public string LEDSecondColor - { - get - { + public string LEDSecondColor { + get { return ((string)(this["LEDSecondColor"])); } - set - { + set { this["LEDSecondColor"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool LEDSettingsUseAccentColor - { - get - { + public bool LEDSettingsUseAccentColor { + get { return ((bool)(this["LEDSettingsUseAccentColor"])); } - set - { + set { this["LEDSettingsUseAccentColor"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("50")] - public double LEDSpeed - { - get - { + public double LEDSpeed { + get { return ((double)(this["LEDSpeed"])); } - set - { + set { this["LEDSpeed"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public global::System.Collections.Specialized.StringCollection SuspendedDevices - { - get - { + public global::System.Collections.Specialized.StringCollection SuspendedDevices { + get { return ((global::System.Collections.Specialized.StringCollection)(this["SuspendedDevices"])); } - set - { + set { this["SuspendedDevices"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool LegionControllerPassthrough - { - get - { + public bool LegionControllerPassthrough { + get { return ((bool)(this["LegionControllerPassthrough"])); } - set - { + set { this["LegionControllerPassthrough"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool OnScreenDisplayToggle - { - get - { + public bool OnScreenDisplayToggle { + get { return ((bool)(this["OnScreenDisplayToggle"])); } - set - { + set { this["OnScreenDisplayToggle"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("2")] - public int LastOnScreenDisplayLevel - { - get - { + public int LastOnScreenDisplayLevel { + get { return ((int)(this["LastOnScreenDisplayLevel"])); } - set - { + set { this["LastOnScreenDisplayLevel"] = value; } } - + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool UISounds { + get { + return ((bool)(this["UISounds"])); + } + set { + this["UISounds"] = value; + } + } + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("2")] - public int OnScreenDisplayTimeLevel - { - get - { - return ((int)(this["OnScreenDisplayTimeLevel"])); - } - set - { + public string OnScreenDisplayTimeLevel { + get { + return ((string)(this["OnScreenDisplayTimeLevel"])); + } + set { this["OnScreenDisplayTimeLevel"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("2")] - public int OnScreenDisplayCPULevel - { - get - { - return ((int)(this["OnScreenDisplayCPULevel"])); - } - set - { + public string OnScreenDisplayCPULevel { + get { + return ((string)(this["OnScreenDisplayCPULevel"])); + } + set { this["OnScreenDisplayCPULevel"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("2")] - public int OnScreenDisplayRAMLevel - { - get - { - return ((int)(this["OnScreenDisplayRAMLevel"])); - } - set - { + public string OnScreenDisplayRAMLevel { + get { + return ((string)(this["OnScreenDisplayRAMLevel"])); + } + set { this["OnScreenDisplayRAMLevel"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("2")] - public int OnScreenDisplayGPULevel - { - get - { - return ((int)(this["OnScreenDisplayGPULevel"])); - } - set - { + public string OnScreenDisplayGPULevel { + get { + return ((string)(this["OnScreenDisplayGPULevel"])); + } + set { this["OnScreenDisplayGPULevel"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("2")] - public int OnScreenDisplayVRAMLevel - { - get - { - return ((int)(this["OnScreenDisplayVRAMLevel"])); - } - set - { + public string OnScreenDisplayVRAMLevel { + get { + return ((string)(this["OnScreenDisplayVRAMLevel"])); + } + set { this["OnScreenDisplayVRAMLevel"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("2")] - public int OnScreenDisplayBatteryLevel - { - get - { - return ((int)(this["OnScreenDisplayBatteryLevel"])); - } - set - { + public string OnScreenDisplayBatteryLevel { + get { + return ((string)(this["OnScreenDisplayBatteryLevel"])); + } + set { this["OnScreenDisplayBatteryLevel"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("2")] - public int OnScreenDisplayFPSLevel - { - get - { - return ((int)(this["OnScreenDisplayFPSLevel"])); - } - set - { + public string OnScreenDisplayFPSLevel { + get { + return ((string)(this["OnScreenDisplayFPSLevel"])); + } + set { this["OnScreenDisplayFPSLevel"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("2")] - public int OnScreenDisplayBATTLevel - { - get - { - return ((int)(this["OnScreenDisplayBATTLevel"])); - } - set - { + public string OnScreenDisplayBATTLevel { + get { + return ((string)(this["OnScreenDisplayBATTLevel"])); + } + set { this["OnScreenDisplayBATTLevel"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("Time,GPU,CPU,VRAM,RAM,BATT,FPS")] - public string OnScreenDisplayOrder - { - get - { + public string OnScreenDisplayOrder { + get { return ((string)(this["OnScreenDisplayOrder"])); } - set - { + set { this["OnScreenDisplayOrder"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool UISounds - { - get - { - return ((bool)(this["UISounds"])); + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int LegionControllerGyroIndex { + get { + return ((int)(this["LegionControllerGyroIndex"])); } - set - { - this["UISounds"] = value; + set { + this["LegionControllerGyroIndex"] = value; } } } diff --git a/HandheldCompanion/Properties/Settings.settings b/HandheldCompanion/Properties/Settings.settings index e3f51a01d..947da597b 100644 --- a/HandheldCompanion/Properties/Settings.settings +++ b/HandheldCompanion/Properties/Settings.settings @@ -251,5 +251,35 @@ False + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + Time,GPU,CPU,VRAM,RAM,BATT,FPS + + + 0 + \ No newline at end of file diff --git a/HandheldCompanion/Views/Pages/ControllerPage.xaml.cs b/HandheldCompanion/Views/Pages/ControllerPage.xaml.cs index d86e2ca3c..5732af4b0 100644 --- a/HandheldCompanion/Views/Pages/ControllerPage.xaml.cs +++ b/HandheldCompanion/Views/Pages/ControllerPage.xaml.cs @@ -86,9 +86,6 @@ private void SettingsManager_SettingValueChanged(string name, object value) Toggle_SCMuteController.IsOn = Convert.ToBoolean(value); ControllerRefresh(); break; - case "LegionControllerPassthrough": - Toggle_TouchpadPassthrough.IsOn = Convert.ToBoolean(value); - break; case "HIDmode": cB_HidMode.SelectedIndex = Convert.ToInt32(value); break; @@ -107,7 +104,7 @@ public void Page_Closed() { } - private void ControllerUnplugged(IController Controller, bool IsPowerCycling) + private void ControllerUnplugged(IController Controller, bool IsPowerCycling, bool WasTarget) { // UI thread (async) Application.Current.Dispatcher.BeginInvoke(() => @@ -267,7 +264,6 @@ private void ControllerRefresh() bool isSteam = hasTarget && (targetController is NeptuneController || targetController is GordonController); MuteVirtualController.Visibility = targetController is SteamController ? Visibility.Visible : Visibility.Collapsed; - TouchpadPassthrough.Visibility = targetController is LegionController ? Visibility.Visible : Visibility.Collapsed; // hint: Has physical controller, but is not connected HintsNoPhysicalConnected.Visibility = @@ -399,12 +395,4 @@ private void Expander_Expanded(object sender, RoutedEventArgs e) { ((Expander)sender).BringIntoView(); } - - private void Toggle_TouchpadPassthrough_Toggled(object sender, RoutedEventArgs e) - { - if (!IsLoaded) - return; - - SettingsManager.SetProperty("LegionControllerPassthrough", Toggle_TouchpadPassthrough.IsOn); - } } \ No newline at end of file diff --git a/HandheldCompanion/Views/Pages/DevicePage.xaml b/HandheldCompanion/Views/Pages/DevicePage.xaml index bd94dea76..260027fa0 100644 --- a/HandheldCompanion/Views/Pages/DevicePage.xaml +++ b/HandheldCompanion/Views/Pages/DevicePage.xaml @@ -590,6 +590,86 @@ Visibility="Collapsed"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HandheldCompanion/Views/Pages/DevicePage.xaml.cs b/HandheldCompanion/Views/Pages/DevicePage.xaml.cs index 65d5b8acc..18c660ffa 100644 --- a/HandheldCompanion/Views/Pages/DevicePage.xaml.cs +++ b/HandheldCompanion/Views/Pages/DevicePage.xaml.cs @@ -137,6 +137,12 @@ private void SettingsManager_SettingValueChanged(string? name, object value) case "LEDUseSecondColor": Toggle_UseSecondColor.IsOn = Convert.ToBoolean(value); break; + case "LegionControllerPassthrough": + Toggle_TouchpadPassthrough.IsOn = Convert.ToBoolean(value); + break; + case "LegionControllerGyroIndex": + ComboBox_GyroController.SelectedIndex = Convert.ToInt32(value); + break; } }); } @@ -355,6 +361,22 @@ private void SetControlEnabledAndVisible(UIElement control, LEDLevel level) #region Legion Go Device Settings + private void Toggle_TouchpadPassthrough_Toggled(object sender, RoutedEventArgs e) + { + if (!IsLoaded) + return; + + SettingsManager.SetProperty("LegionControllerPassthrough", Toggle_TouchpadPassthrough.IsOn); + } + + private void ComboBox_GyroController_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (!IsLoaded) + return; + + SettingsManager.SetProperty("LegionControllerGyroIndex", ComboBox_GyroController.SelectedIndex); + } + private void SliderLeftJoystickDeadzone_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) { var value = SliderLeftJoystickDeadzone.Value;