Optimized USB-C fix

This commit is contained in:
Serge
2023-08-05 13:17:50 +02:00
parent fa3d9d1f81
commit 0fec4c9620
4 changed files with 10 additions and 7 deletions

View File

@@ -15,7 +15,7 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.105</AssemblyVersion> <AssemblyVersion>0.106</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -176,10 +176,14 @@ namespace GHelper.Gpu
public static bool IsPlugged() public static bool IsPlugged()
{ {
bool optimizedUSBC = AppConfig.Get("optimized_usbc") != 1; if (SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online) return false;
if (!AppConfig.Is("optimized_usbc")) return true;
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online && int chargerMode = Program.acpi.DeviceGet(AsusACPI.ChargerMode);
(optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) < AsusACPI.ChargerUSB); Logger.WriteLine("ChargerStatus: " + chargerMode);
if (chargerMode < 0) return true;
return (chargerMode & AsusACPI.ChargerBarrel) > 0;
} }

View File

@@ -436,7 +436,6 @@ namespace GHelper.Input
KeyProcess("paddle"); KeyProcess("paddle");
return; return;
// The Command Center ("play-looking") button below the select key. // The Command Center ("play-looking") button below the select key.
// We'll call this M3.
case 166: case 166:
KeyProcess("cc"); KeyProcess("cc");
return; return;

View File

@@ -438,7 +438,7 @@ namespace GHelper
// checkStartup // checkStartup
// //
checkStartup.AutoSize = true; checkStartup.AutoSize = true;
checkStartup.Location = new Point(36, 11); checkStartup.Location = new Point(24, 11);
checkStartup.Margin = new Padding(11, 5, 11, 5); checkStartup.Margin = new Padding(11, 5, 11, 5);
checkStartup.Name = "checkStartup"; checkStartup.Name = "checkStartup";
checkStartup.Size = new Size(206, 36); checkStartup.Size = new Size(206, 36);
@@ -1202,7 +1202,7 @@ namespace GHelper
labelCharge.Dock = DockStyle.Right; labelCharge.Dock = DockStyle.Right;
labelCharge.ForeColor = SystemColors.ControlDark; labelCharge.ForeColor = SystemColors.ControlDark;
labelCharge.Location = new Point(365, 0); labelCharge.Location = new Point(365, 0);
labelCharge.Margin = new Padding(0, 0, 0, 0); labelCharge.Margin = new Padding(0);
labelCharge.Name = "labelCharge"; labelCharge.Name = "labelCharge";
labelCharge.Padding = new Padding(0, 0, 20, 0); labelCharge.Padding = new Padding(0, 0, 20, 0);
labelCharge.Size = new Size(462, 56); labelCharge.Size = new Size(462, 56);