mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
773c50579c | ||
|
|
59bfe845c6 | ||
|
|
95909bd951 | ||
|
|
ac89645476 |
13
app/Extra.Designer.cs
generated
13
app/Extra.Designer.cs
generated
@@ -791,30 +791,35 @@ namespace GHelper
|
|||||||
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
tableBacklight.Controls.Add(checkBatteryLogo, 0, 5);
|
|
||||||
tableBacklight.Controls.Add(checkBattery, 0, 5);
|
|
||||||
tableBacklight.Controls.Add(checkBatteryLid, 0, 5);
|
|
||||||
tableBacklight.Controls.Add(checkBatteryBar, 0, 5);
|
|
||||||
tableBacklight.Controls.Add(labelBacklightKeyboard, 0, 0);
|
tableBacklight.Controls.Add(labelBacklightKeyboard, 0, 0);
|
||||||
tableBacklight.Controls.Add(checkAwake, 0, 1);
|
tableBacklight.Controls.Add(checkAwake, 0, 1);
|
||||||
tableBacklight.Controls.Add(checkBoot, 0, 2);
|
tableBacklight.Controls.Add(checkBoot, 0, 2);
|
||||||
tableBacklight.Controls.Add(checkSleep, 0, 3);
|
tableBacklight.Controls.Add(checkSleep, 0, 3);
|
||||||
tableBacklight.Controls.Add(checkShutdown, 0, 4);
|
tableBacklight.Controls.Add(checkShutdown, 0, 4);
|
||||||
|
tableBacklight.Controls.Add(checkBattery, 0, 5);
|
||||||
|
|
||||||
tableBacklight.Controls.Add(labelBacklightLogo, 1, 0);
|
tableBacklight.Controls.Add(labelBacklightLogo, 1, 0);
|
||||||
tableBacklight.Controls.Add(checkAwakeLogo, 1, 1);
|
tableBacklight.Controls.Add(checkAwakeLogo, 1, 1);
|
||||||
tableBacklight.Controls.Add(checkBootLogo, 1, 2);
|
tableBacklight.Controls.Add(checkBootLogo, 1, 2);
|
||||||
tableBacklight.Controls.Add(checkSleepLogo, 1, 3);
|
tableBacklight.Controls.Add(checkSleepLogo, 1, 3);
|
||||||
tableBacklight.Controls.Add(checkShutdownLogo, 1, 4);
|
tableBacklight.Controls.Add(checkShutdownLogo, 1, 4);
|
||||||
|
tableBacklight.Controls.Add(checkBatteryLogo, 1, 5);
|
||||||
|
|
||||||
tableBacklight.Controls.Add(labelBacklightBar, 2, 0);
|
tableBacklight.Controls.Add(labelBacklightBar, 2, 0);
|
||||||
tableBacklight.Controls.Add(checkAwakeBar, 2, 1);
|
tableBacklight.Controls.Add(checkAwakeBar, 2, 1);
|
||||||
tableBacklight.Controls.Add(checkBootBar, 2, 2);
|
tableBacklight.Controls.Add(checkBootBar, 2, 2);
|
||||||
tableBacklight.Controls.Add(checkSleepBar, 2, 3);
|
tableBacklight.Controls.Add(checkSleepBar, 2, 3);
|
||||||
tableBacklight.Controls.Add(checkShutdownBar, 2, 4);
|
tableBacklight.Controls.Add(checkShutdownBar, 2, 4);
|
||||||
|
tableBacklight.Controls.Add(checkBatteryBar, 2, 5);
|
||||||
|
|
||||||
tableBacklight.Controls.Add(labelBacklightLid, 3, 0);
|
tableBacklight.Controls.Add(labelBacklightLid, 3, 0);
|
||||||
tableBacklight.Controls.Add(checkAwakeLid, 3, 1);
|
tableBacklight.Controls.Add(checkAwakeLid, 3, 1);
|
||||||
tableBacklight.Controls.Add(checkBootLid, 3, 2);
|
tableBacklight.Controls.Add(checkBootLid, 3, 2);
|
||||||
tableBacklight.Controls.Add(checkSleepLid, 3, 3);
|
tableBacklight.Controls.Add(checkSleepLid, 3, 3);
|
||||||
tableBacklight.Controls.Add(checkShutdownLid, 3, 4);
|
tableBacklight.Controls.Add(checkShutdownLid, 3, 4);
|
||||||
|
tableBacklight.Controls.Add(checkBatteryLid, 3, 5);
|
||||||
|
|
||||||
tableBacklight.Dock = DockStyle.Top;
|
tableBacklight.Dock = DockStyle.Top;
|
||||||
tableBacklight.Location = new Point(0, 5);
|
tableBacklight.Location = new Point(0, 5);
|
||||||
tableBacklight.Margin = new Padding(0);
|
tableBacklight.Margin = new Padding(0);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.177</AssemblyVersion>
|
<AssemblyVersion>0.178</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -130,5 +130,40 @@
|
|||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override int MaxDPI()
|
||||||
|
{
|
||||||
|
return 8_000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int MinDPI()
|
||||||
|
{
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int DPIIncrements()
|
||||||
|
{
|
||||||
|
return 50;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool HasDPIColors()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override int ParseDPIProfile(byte[] packet)
|
||||||
|
{
|
||||||
|
return base.ParseDPIProfile(packet) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override byte[] GetChangeDPIProfilePacket(int profile)
|
||||||
|
{
|
||||||
|
return new byte[] { reportId, 0x51, 0x31, 0x0A, 0x00, 0x04 };
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override byte[] GetChangeDPIProfilePacket2(int profile)
|
||||||
|
{
|
||||||
|
return new byte[] { reportId, 0x51, 0x31, 0x09, 0x00, (byte)(profile - 1) };
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,10 +208,10 @@ namespace GHelper
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void SetAutoModes(bool powerChanged = false, bool init = false)
|
public static bool SetAutoModes(bool powerChanged = false, bool init = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 3000) return;
|
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 3000) return false;
|
||||||
lastAuto = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
lastAuto = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||||
|
|
||||||
isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
||||||
@@ -240,6 +240,8 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
settingsForm.AutoKeyboard();
|
settingsForm.AutoKeyboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
||||||
|
|||||||
@@ -674,7 +674,7 @@ namespace GHelper
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
Logger.WriteLine("Monitor Power On");
|
Logger.WriteLine("Monitor Power On");
|
||||||
Program.SetAutoModes();
|
if (!Program.SetAutoModes()) BatteryControl.AutoBattery();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
Logger.WriteLine("Monitor Dimmed");
|
Logger.WriteLine("Monitor Dimmed");
|
||||||
|
|||||||
Reference in New Issue
Block a user