Compare commits

...

31 Commits

Author SHA1 Message Date
Serge
a49ac1072e Folder path fix 2024-03-08 09:55:07 +01:00
Serge
1b098cd3ee Version bump 2024-03-08 09:49:59 +01:00
Serge
a05eaea343 UI Tweaks 2024-03-08 09:48:46 +01:00
Serge
f749bfc888 Fixed case when directory doesn't exist 2024-03-08 00:34:01 +01:00
Serge
84f03d7455 Visual modes and Gamut Modes (#2176)
* Visual Modes

* UI Tweaks

* Eye-care mode

* Save visuals in UI

* Init fallbacks
2024-03-07 23:11:00 +01:00
Serge
816988eb6c Added K650 to OLED list 2024-03-07 18:32:48 +01:00
Serge
312028f97c Path detection 2024-03-07 18:22:30 +01:00
Serge
211b855e8a No overdrive for OLED 2024-03-07 15:19:41 +01:00
Serge
d3d2f3189f Dimming init fallback 2024-03-07 14:46:28 +01:00
Serge
4120113cbe Merge branch 'main' of https://github.com/seerge/g-helper 2024-03-07 14:34:02 +01:00
Serge
1191208f70 Dimming init 2024-03-07 14:33:39 +01:00
IceStormNG
c7db5a403c Mouse UI Fixes (#2173)
* Support for Strix Carry (P508)

* Fixes polling rate, angle snapping and debounce for Gladius II Origin.

* The Gen2 version of the TuF M3 uses 0-100 for brightness.

* Adds support for ROG Strix Impact III (P518)

* Import/Export feature for mice.

* Suppor for Strix Impact (P303)

* Support for Strix Impact II Electro Punk

* Strix Carry has 50 DPI minimum and increments of 50.

* Respect top-most setting of GHelper

* Fixes to the buttons to be wider to fit longer translations.
2024-03-07 14:15:01 +01:00
Serge
35ceea878f Brightness fallback 2024-03-07 14:12:20 +01:00
Serge
06378162c8 Ambient mode tweak for 2024 models 2024-03-07 13:39:34 +01:00
Serge
a688275ca2 Lower ambient mode refresh rate for single-zone models 2024-03-07 12:06:11 +01:00
Serge
4c5e05d6f8 Brightness slider UI tweaks 2024-03-07 11:39:54 +01:00
Serge
d77acfd97a Version bump 2024-03-07 11:28:21 +01:00
Serge
092ecc7ede Dimming hotkeys 2024-03-07 11:00:38 +01:00
Serge
0b3d52fc0e UI Tweaks 2024-03-07 00:27:36 +01:00
Serge
2797807d7b Improved dimming 2024-03-06 23:28:21 +01:00
Serge
6075676372 Max GPU Power param in config 2024-03-06 10:46:28 +01:00
Serge
0705edd83d Overdrive UI tweak https://github.com/seerge/g-helper/issues/2166 2024-03-05 22:19:23 +01:00
Serge
6dcfff704e Sleep hotkey for TUF devices 2024-03-05 14:49:27 +01:00
Serge
abc9acd3a8 UV Cleanup 2024-03-05 12:27:06 +01:00
Serge
53d7382417 Set GPU Clocks earlier 2024-03-05 01:17:40 +01:00
Serge
64f4572113 UI tweaks 2024-03-05 00:31:25 +01:00
Serge
8ab1f1fc81 Workaround for bugged BIOS on G14 2024 2024-03-05 00:08:46 +01:00
IceStormNG
251d32e115 Mouse fixes (#2159)
* Support for Strix Carry (P508)

* Fixes polling rate, angle snapping and debounce for Gladius II Origin.

* The Gen2 version of the TuF M3 uses 0-100 for brightness.

* Adds support for ROG Strix Impact III (P518)

* Import/Export feature for mice.

* Suppor for Strix Impact (P303)

* Support for Strix Impact II Electro Punk

* Strix Carry has 50 DPI minimum and increments of 50.
2024-03-03 17:15:40 +01:00
Serge
947e32b97c GPU Power slider fix 2024-03-03 10:24:33 +01:00
Serge
091303d90f Swapped fan curves workaround https://github.com/seerge/g-helper/issues/2155 2024-03-03 10:19:00 +01:00
Serge
c8b929310a Zenbook fn-lock https://github.com/seerge/g-helper/issues/2154 2024-03-03 10:17:25 +01:00
23 changed files with 624 additions and 1126 deletions

View File

@@ -365,9 +365,9 @@ public static class AppConfig
return ContainsModel("ProArt");
}
public static bool IsVivobook()
public static bool IsVivoZenbook()
{
return ContainsModel("Vivobook");
return ContainsModel("Vivobook") || ContainsModel("Zenbook");
}
// Devices with bugged bios command to change brightness
@@ -405,7 +405,12 @@ public static class AppConfig
public static bool IsOLED()
{
return ContainsModel("OLED") || IsSlash() || ContainsModel("UX64") || ContainsModel("UX34") || ContainsModel("UX53") || ContainsModel("K360") || ContainsModel("X150");
return ContainsModel("OLED") || IsSlash() || ContainsModel("UX64") || ContainsModel("UX34") || ContainsModel("UX53") || ContainsModel("K360") || ContainsModel("X150") || ContainsModel("M3500") || ContainsModel("K650");
}
public static bool IsNoOverdrive()
{
return Is("no_overdrive") || IsOLED();
}
public static bool IsStrix()
@@ -431,7 +436,7 @@ public static class AppConfig
public static bool IsNoDirectRGB()
{
return ContainsModel("GA503") || ContainsModel("G533Q");
return ContainsModel("GA503") || ContainsModel("G533Q") || IsSlash();
}
public static bool IsStrixNumpad()
@@ -514,7 +519,7 @@ public static class AppConfig
try
{
var (bios, model) = GetBiosAndModel();
return (Int32.Parse(bios) == 317);
return (Int32.Parse(bios) == 317 || Int32.Parse(bios) == 316);
}
catch
{
@@ -522,9 +527,19 @@ public static class AppConfig
}
}
public static bool IsResetRequired()
{
return ContainsModel("GA403");
}
public static bool IsFanRequired()
{
return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R") || ContainsModel("G713P");
return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R") || ContainsModel("G713P") || ContainsModel("GU605") || ContainsModel("GA403");
}
public static bool IsAMDLight()
{
return ContainsModel("GA402X") || ContainsModel("GA403") || ContainsModel("FA507N") || ContainsModel("FA507X") || ContainsModel("FA707N") || ContainsModel("FA707X");
}
public static bool IsPowerRequired()
@@ -562,6 +577,10 @@ public static class AppConfig
return ContainsModel("G834") || ContainsModel("G614") || ContainsModel("G834") || ContainsModel("G634");
}
public static bool IsROG()
{
return ContainsModel("ROG");
}
public static bool IsASUS()
{
return ContainsModel("ROG") || ContainsModel("TUF") || ContainsModel("Vivobook") || ContainsModel("Zenbook");

View File

@@ -296,7 +296,7 @@ public class AsusACPI
if (AppConfig.IsSlash())
{
MaxGPUPower = 25;
MaxGPUPower = AppConfig.Get("max_gpu_power", 25);
}
if (AppConfig.DynamicBoost5())
@@ -308,6 +308,14 @@ public class AsusACPI
{
MaxGPUBoost = 15;
}
if (AppConfig.IsAMDLight())
{
MaxTotal = 90;
}
}
public void Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
@@ -421,9 +429,16 @@ public class AsusACPI
{
return null;
}
}
public int SetVivoMode(int mode)
{
if (mode == 1) mode = 2;
else if (mode == 2) mode = 1;
return Program.acpi.DeviceSet(VivoBookMode, mode, "VivoMode");
}
public int SetGPUEco(int eco)
{
int ecoFlag = DeviceGet(GPUEco);

View File

@@ -152,7 +152,7 @@
//
panelProfiles.Controls.Add(comboProfile);
panelProfiles.Controls.Add(labelProfile);
panelProfiles.Location = new Point(212, 2);
panelProfiles.Location = new Point(220, 2);
panelProfiles.Margin = new Padding(2);
panelProfiles.MinimumSize = new Size(227, 0);
panelProfiles.Name = "panelProfiles";
@@ -197,7 +197,7 @@
panelPerformance.Margin = new Padding(2);
panelPerformance.Name = "panelPerformance";
panelPerformance.Padding = new Padding(0, 7, 0, 17);
panelPerformance.Size = new Size(420, 370);
panelPerformance.Size = new Size(437, 370);
panelPerformance.TabIndex = 1;
//
// panelPerformanceOther
@@ -215,7 +215,7 @@
panelPerformanceOther.Margin = new Padding(2);
panelPerformanceOther.Name = "panelPerformanceOther";
panelPerformanceOther.Padding = new Padding(0, 7, 0, 7);
panelPerformanceOther.Size = new Size(420, 192);
panelPerformanceOther.Size = new Size(437, 192);
panelPerformanceOther.TabIndex = 49;
//
// panelDeceleration
@@ -230,7 +230,7 @@
panelDeceleration.Margin = new Padding(2);
panelDeceleration.Name = "panelDeceleration";
panelDeceleration.Padding = new Padding(3);
panelDeceleration.Size = new Size(420, 31);
panelDeceleration.Size = new Size(437, 31);
panelDeceleration.TabIndex = 58;
//
// labelDeceleration
@@ -279,7 +279,7 @@
panelAcceleration.Margin = new Padding(2);
panelAcceleration.Name = "panelAcceleration";
panelAcceleration.Padding = new Padding(3);
panelAcceleration.Size = new Size(420, 31);
panelAcceleration.Size = new Size(437, 31);
panelAcceleration.TabIndex = 57;
//
// labelAcceleration
@@ -327,7 +327,7 @@
panelLiftOffDistance.Margin = new Padding(2);
panelLiftOffDistance.Name = "panelLiftOffDistance";
panelLiftOffDistance.Padding = new Padding(3);
panelLiftOffDistance.Size = new Size(420, 29);
panelLiftOffDistance.Size = new Size(437, 29);
panelLiftOffDistance.TabIndex = 56;
//
// labelLiftOffDistance
@@ -364,7 +364,7 @@
panelDebounce.Margin = new Padding(2);
panelDebounce.Name = "panelDebounce";
panelDebounce.Padding = new Padding(3);
panelDebounce.Size = new Size(420, 31);
panelDebounce.Size = new Size(437, 31);
panelDebounce.TabIndex = 55;
//
// labelButtonDebounce
@@ -413,7 +413,7 @@
panelAngleSnapping.Margin = new Padding(2);
panelAngleSnapping.Name = "panelAngleSnapping";
panelAngleSnapping.Padding = new Padding(3);
panelAngleSnapping.Size = new Size(420, 29);
panelAngleSnapping.Size = new Size(437, 29);
panelAngleSnapping.TabIndex = 54;
//
// sliderAngleAdjustment
@@ -464,7 +464,7 @@
panelPollingRate.Margin = new Padding(2);
panelPollingRate.Name = "panelPollingRate";
panelPollingRate.Padding = new Padding(3);
panelPollingRate.Size = new Size(420, 27);
panelPollingRate.Size = new Size(437, 27);
panelPollingRate.TabIndex = 53;
//
// labelPollingRate
@@ -500,7 +500,7 @@
panelDPISettings.Location = new Point(0, 91);
panelDPISettings.Margin = new Padding(2);
panelDPISettings.Name = "panelDPISettings";
panelDPISettings.Size = new Size(420, 70);
panelDPISettings.Size = new Size(437, 70);
panelDPISettings.TabIndex = 44;
//
// sliderDPI
@@ -512,7 +512,7 @@
sliderDPI.Max = 35000;
sliderDPI.Min = 100;
sliderDPI.Name = "sliderDPI";
sliderDPI.Size = new Size(420, 20);
sliderDPI.Size = new Size(437, 20);
sliderDPI.Step = 50;
sliderDPI.TabIndex = 43;
sliderDPI.TabStop = false;
@@ -537,7 +537,7 @@
tableLayoutPanel1.Name = "tableLayoutPanel1";
tableLayoutPanel1.RowCount = 1;
tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
tableLayoutPanel1.Size = new Size(420, 23);
tableLayoutPanel1.Size = new Size(437, 23);
tableLayoutPanel1.TabIndex = 47;
//
// labelMinDPI
@@ -547,7 +547,7 @@
labelMinDPI.Location = new Point(4, 0);
labelMinDPI.Margin = new Padding(4, 0, 4, 0);
labelMinDPI.Name = "labelMinDPI";
labelMinDPI.Size = new Size(151, 23);
labelMinDPI.Size = new Size(158, 23);
labelMinDPI.TabIndex = 45;
labelMinDPI.Text = "100";
//
@@ -555,10 +555,10 @@
//
labelMaxDPI.Dock = DockStyle.Fill;
labelMaxDPI.ForeColor = SystemColors.GrayText;
labelMaxDPI.Location = new Point(263, 0);
labelMaxDPI.Location = new Point(274, 0);
labelMaxDPI.Margin = new Padding(4, 0, 4, 0);
labelMaxDPI.Name = "labelMaxDPI";
labelMaxDPI.Size = new Size(153, 23);
labelMaxDPI.Size = new Size(159, 23);
labelMaxDPI.TabIndex = 46;
labelMaxDPI.Text = " 35000";
labelMaxDPI.TextAlign = ContentAlignment.TopRight;
@@ -568,12 +568,12 @@
numericUpDownCurrentDPI.BorderStyle = BorderStyle.None;
numericUpDownCurrentDPI.Dock = DockStyle.Fill;
numericUpDownCurrentDPI.Increment = new decimal(new int[] { 50, 0, 0, 0 });
numericUpDownCurrentDPI.Location = new Point(161, 2);
numericUpDownCurrentDPI.Location = new Point(168, 2);
numericUpDownCurrentDPI.Margin = new Padding(2);
numericUpDownCurrentDPI.Maximum = new decimal(new int[] { 35000, 0, 0, 0 });
numericUpDownCurrentDPI.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownCurrentDPI.Name = "numericUpDownCurrentDPI";
numericUpDownCurrentDPI.Size = new Size(96, 19);
numericUpDownCurrentDPI.Size = new Size(100, 19);
numericUpDownCurrentDPI.TabIndex = 47;
numericUpDownCurrentDPI.TextAlign = HorizontalAlignment.Center;
numericUpDownCurrentDPI.Value = new decimal(new int[] { 2000, 0, 0, 0 });
@@ -588,13 +588,13 @@
panelDPITile.Margin = new Padding(2);
panelDPITile.Name = "panelDPITile";
panelDPITile.Padding = new Padding(0, 3, 0, 3);
panelDPITile.Size = new Size(420, 27);
panelDPITile.Size = new Size(437, 27);
panelDPITile.TabIndex = 48;
//
// pictureDPIColor
//
pictureDPIColor.Anchor = AnchorStyles.Top | AnchorStyles.Right;
pictureDPIColor.Location = new Point(395, 7);
pictureDPIColor.Location = new Point(412, 7);
pictureDPIColor.Margin = new Padding(4);
pictureDPIColor.Name = "pictureDPIColor";
pictureDPIColor.Size = new Size(10, 10);
@@ -612,7 +612,7 @@
buttonDPIColor.BorderRadius = 2;
buttonDPIColor.FlatStyle = FlatStyle.Flat;
buttonDPIColor.ForeColor = SystemColors.ControlText;
buttonDPIColor.Location = new Point(291, 1);
buttonDPIColor.Location = new Point(308, 1);
buttonDPIColor.Margin = new Padding(2, 4, 2, 4);
buttonDPIColor.Name = "buttonDPIColor";
buttonDPIColor.Secondary = false;
@@ -653,7 +653,7 @@
tableDPI.RowCount = 1;
tableDPI.RowStyles.Add(new RowStyle(SizeType.Absolute, 64F));
tableDPI.RowStyles.Add(new RowStyle(SizeType.Absolute, 64F));
tableDPI.Size = new Size(420, 64);
tableDPI.Size = new Size(437, 64);
tableDPI.TabIndex = 42;
//
// buttonDPI2
@@ -669,11 +669,11 @@
buttonDPI2.ForeColor = SystemColors.ControlText;
buttonDPI2.Image = Properties.Resources.lighting_dot_32;
buttonDPI2.ImageAlign = ContentAlignment.BottomCenter;
buttonDPI2.Location = new Point(107, 2);
buttonDPI2.Location = new Point(111, 2);
buttonDPI2.Margin = new Padding(2);
buttonDPI2.Name = "buttonDPI2";
buttonDPI2.Secondary = false;
buttonDPI2.Size = new Size(101, 60);
buttonDPI2.Size = new Size(105, 60);
buttonDPI2.TabIndex = 4;
buttonDPI2.Text = "DPI 2\r\n1000";
buttonDPI2.TextImageRelation = TextImageRelation.ImageAboveText;
@@ -696,7 +696,7 @@
buttonDPI1.Margin = new Padding(2);
buttonDPI1.Name = "buttonDPI1";
buttonDPI1.Secondary = false;
buttonDPI1.Size = new Size(101, 60);
buttonDPI1.Size = new Size(105, 60);
buttonDPI1.TabIndex = 4;
buttonDPI1.Text = "DPI 1\r\n800";
buttonDPI1.TextImageRelation = TextImageRelation.ImageAboveText;
@@ -715,11 +715,11 @@
buttonDPI3.ForeColor = SystemColors.ControlText;
buttonDPI3.Image = Properties.Resources.lighting_dot_32;
buttonDPI3.ImageAlign = ContentAlignment.BottomCenter;
buttonDPI3.Location = new Point(212, 2);
buttonDPI3.Location = new Point(220, 2);
buttonDPI3.Margin = new Padding(2);
buttonDPI3.Name = "buttonDPI3";
buttonDPI3.Secondary = false;
buttonDPI3.Size = new Size(101, 60);
buttonDPI3.Size = new Size(105, 60);
buttonDPI3.TabIndex = 5;
buttonDPI3.Text = "DPI 3\r\n1200";
buttonDPI3.TextImageRelation = TextImageRelation.ImageAboveText;
@@ -738,11 +738,11 @@
buttonDPI4.ForeColor = SystemColors.ControlText;
buttonDPI4.Image = Properties.Resources.lighting_dot_32;
buttonDPI4.ImageAlign = ContentAlignment.BottomCenter;
buttonDPI4.Location = new Point(317, 2);
buttonDPI4.Location = new Point(329, 2);
buttonDPI4.Margin = new Padding(2);
buttonDPI4.Name = "buttonDPI4";
buttonDPI4.Secondary = false;
buttonDPI4.Size = new Size(101, 60);
buttonDPI4.Size = new Size(106, 60);
buttonDPI4.TabIndex = 6;
buttonDPI4.Text = "DPI 4\r\n1400";
buttonDPI4.TextImageRelation = TextImageRelation.ImageAboveText;
@@ -757,7 +757,7 @@
panelPerformanceHeader.Location = new Point(0, 7);
panelPerformanceHeader.Margin = new Padding(2);
panelPerformanceHeader.Name = "panelPerformanceHeader";
panelPerformanceHeader.Size = new Size(420, 20);
panelPerformanceHeader.Size = new Size(437, 20);
panelPerformanceHeader.TabIndex = 41;
//
// pictureKeyboard
@@ -793,7 +793,7 @@
panelLighting.Margin = new Padding(2);
panelLighting.Name = "panelLighting";
panelLighting.Padding = new Padding(0, 0, 0, 17);
panelLighting.Size = new Size(420, 220);
panelLighting.Size = new Size(437, 220);
panelLighting.TabIndex = 42;
//
// panelLightingContent
@@ -814,7 +814,7 @@
panelLightingContent.Margin = new Padding(2);
panelLightingContent.Name = "panelLightingContent";
panelLightingContent.Padding = new Padding(0, 0, 0, 7);
panelLightingContent.Size = new Size(420, 183);
panelLightingContent.Size = new Size(437, 183);
panelLightingContent.TabIndex = 42;
//
// tableLayoutLightingZones
@@ -838,7 +838,7 @@
tableLayoutLightingZones.Name = "tableLayoutLightingZones";
tableLayoutLightingZones.RowCount = 1;
tableLayoutLightingZones.RowStyles.Add(new RowStyle(SizeType.Absolute, 40F));
tableLayoutLightingZones.Size = new Size(420, 40);
tableLayoutLightingZones.Size = new Size(437, 40);
tableLayoutLightingZones.TabIndex = 56;
//
// buttonLightingZoneScroll
@@ -855,11 +855,11 @@
buttonLightingZoneScroll.FlatStyle = FlatStyle.Flat;
buttonLightingZoneScroll.ForeColor = SystemColors.ControlText;
buttonLightingZoneScroll.ImageAlign = ContentAlignment.BottomCenter;
buttonLightingZoneScroll.Location = new Point(170, 2);
buttonLightingZoneScroll.Location = new Point(176, 2);
buttonLightingZoneScroll.Margin = new Padding(2);
buttonLightingZoneScroll.Name = "buttonLightingZoneScroll";
buttonLightingZoneScroll.Secondary = false;
buttonLightingZoneScroll.Size = new Size(80, 36);
buttonLightingZoneScroll.Size = new Size(83, 36);
buttonLightingZoneScroll.TabIndex = 7;
buttonLightingZoneScroll.Text = "Scrollwheel";
buttonLightingZoneScroll.TextImageRelation = TextImageRelation.ImageAboveText;
@@ -879,11 +879,11 @@
buttonLightingZoneLogo.FlatStyle = FlatStyle.Flat;
buttonLightingZoneLogo.ForeColor = SystemColors.ControlText;
buttonLightingZoneLogo.ImageAlign = ContentAlignment.BottomCenter;
buttonLightingZoneLogo.Location = new Point(86, 2);
buttonLightingZoneLogo.Location = new Point(89, 2);
buttonLightingZoneLogo.Margin = new Padding(2);
buttonLightingZoneLogo.Name = "buttonLightingZoneLogo";
buttonLightingZoneLogo.Secondary = false;
buttonLightingZoneLogo.Size = new Size(80, 36);
buttonLightingZoneLogo.Size = new Size(83, 36);
buttonLightingZoneLogo.TabIndex = 4;
buttonLightingZoneLogo.Text = "Logo";
buttonLightingZoneLogo.TextImageRelation = TextImageRelation.ImageAboveText;
@@ -907,7 +907,7 @@
buttonLightingZoneAll.Margin = new Padding(2);
buttonLightingZoneAll.Name = "buttonLightingZoneAll";
buttonLightingZoneAll.Secondary = false;
buttonLightingZoneAll.Size = new Size(80, 36);
buttonLightingZoneAll.Size = new Size(83, 36);
buttonLightingZoneAll.TabIndex = 4;
buttonLightingZoneAll.Text = "All";
buttonLightingZoneAll.TextImageRelation = TextImageRelation.ImageAboveText;
@@ -927,11 +927,11 @@
buttonLightingZoneUnderglow.FlatStyle = FlatStyle.Flat;
buttonLightingZoneUnderglow.ForeColor = SystemColors.ControlText;
buttonLightingZoneUnderglow.ImageAlign = ContentAlignment.BottomCenter;
buttonLightingZoneUnderglow.Location = new Point(254, 2);
buttonLightingZoneUnderglow.Location = new Point(263, 2);
buttonLightingZoneUnderglow.Margin = new Padding(2);
buttonLightingZoneUnderglow.Name = "buttonLightingZoneUnderglow";
buttonLightingZoneUnderglow.Secondary = false;
buttonLightingZoneUnderglow.Size = new Size(80, 36);
buttonLightingZoneUnderglow.Size = new Size(83, 36);
buttonLightingZoneUnderglow.TabIndex = 5;
buttonLightingZoneUnderglow.Text = "Underglow";
buttonLightingZoneUnderglow.TextImageRelation = TextImageRelation.ImageAboveText;
@@ -951,11 +951,11 @@
buttonLightingZoneDock.FlatStyle = FlatStyle.Flat;
buttonLightingZoneDock.ForeColor = SystemColors.ControlText;
buttonLightingZoneDock.ImageAlign = ContentAlignment.BottomCenter;
buttonLightingZoneDock.Location = new Point(338, 2);
buttonLightingZoneDock.Location = new Point(350, 2);
buttonLightingZoneDock.Margin = new Padding(2);
buttonLightingZoneDock.Name = "buttonLightingZoneDock";
buttonLightingZoneDock.Secondary = false;
buttonLightingZoneDock.Size = new Size(80, 36);
buttonLightingZoneDock.Size = new Size(85, 36);
buttonLightingZoneDock.TabIndex = 6;
buttonLightingZoneDock.Text = "Dock";
buttonLightingZoneDock.TextImageRelation = TextImageRelation.ImageAboveText;
@@ -968,10 +968,10 @@
comboBoxAnimationDirection.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxAnimationDirection.FlatStyle = FlatStyle.Flat;
comboBoxAnimationDirection.FormattingEnabled = true;
comboBoxAnimationDirection.Location = new Point(244, 153);
comboBoxAnimationDirection.Location = new Point(245, 153);
comboBoxAnimationDirection.Margin = new Padding(11, 0, 11, 0);
comboBoxAnimationDirection.Name = "comboBoxAnimationDirection";
comboBoxAnimationDirection.Size = new Size(191, 23);
comboBoxAnimationDirection.Size = new Size(190, 23);
comboBoxAnimationDirection.TabIndex = 54;
//
// labelAnimationDirection
@@ -1000,10 +1000,10 @@
comboBoxAnimationSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxAnimationSpeed.FlatStyle = FlatStyle.Flat;
comboBoxAnimationSpeed.FormattingEnabled = true;
comboBoxAnimationSpeed.Location = new Point(244, 125);
comboBoxAnimationSpeed.Location = new Point(245, 125);
comboBoxAnimationSpeed.Margin = new Padding(11, 0, 11, 0);
comboBoxAnimationSpeed.Name = "comboBoxAnimationSpeed";
comboBoxAnimationSpeed.Size = new Size(191, 23);
comboBoxAnimationSpeed.Size = new Size(190, 23);
comboBoxAnimationSpeed.TabIndex = 51;
//
// labelAnimationSpeed
@@ -1018,7 +1018,7 @@
// pictureBoxLightingColor
//
pictureBoxLightingColor.Anchor = AnchorStyles.Top | AnchorStyles.Right;
pictureBoxLightingColor.Location = new Point(304, 80);
pictureBoxLightingColor.Location = new Point(321, 80);
pictureBoxLightingColor.Margin = new Padding(4);
pictureBoxLightingColor.Name = "pictureBoxLightingColor";
pictureBoxLightingColor.Size = new Size(13, 13);
@@ -1035,11 +1035,11 @@
buttonLightingColor.BorderRadius = 2;
buttonLightingColor.FlatStyle = FlatStyle.Flat;
buttonLightingColor.ForeColor = SystemColors.ControlText;
buttonLightingColor.Location = new Point(233, 74);
buttonLightingColor.Location = new Point(252, 74);
buttonLightingColor.Margin = new Padding(2, 4, 2, 4);
buttonLightingColor.Name = "buttonLightingColor";
buttonLightingColor.Secondary = false;
buttonLightingColor.Size = new Size(94, 25);
buttonLightingColor.Size = new Size(90, 25);
buttonLightingColor.TabIndex = 49;
buttonLightingColor.Text = Properties.Strings.Color;
buttonLightingColor.TextAlign = ContentAlignment.MiddleLeft;
@@ -1077,13 +1077,13 @@
panelLightingHeader.Location = new Point(0, 0);
panelLightingHeader.Margin = new Padding(2);
panelLightingHeader.Name = "panelLightingHeader";
panelLightingHeader.Size = new Size(420, 20);
panelLightingHeader.Size = new Size(437, 20);
panelLightingHeader.TabIndex = 41;
//
// sliderBrightness
//
sliderBrightness.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
sliderBrightness.Location = new Point(229, 1);
sliderBrightness.Location = new Point(246, 1);
sliderBrightness.Margin = new Padding(1);
sliderBrightness.Max = 100;
sliderBrightness.Min = 0;
@@ -1131,7 +1131,7 @@
panelEnergy.Margin = new Padding(2);
panelEnergy.Name = "panelEnergy";
panelEnergy.Padding = new Padding(0, 0, 0, 17);
panelEnergy.Size = new Size(420, 96);
panelEnergy.Size = new Size(437, 96);
panelEnergy.TabIndex = 43;
//
// labelLowBatteryWarningValue
@@ -1199,7 +1199,7 @@
panelEnergyHeader.Location = new Point(0, 0);
panelEnergyHeader.Margin = new Padding(2);
panelEnergyHeader.Name = "panelEnergyHeader";
panelEnergyHeader.Size = new Size(420, 20);
panelEnergyHeader.Size = new Size(437, 20);
panelEnergyHeader.TabIndex = 41;
//
// pictureBoxEnergy
@@ -1240,7 +1240,7 @@
tableLayoutProfiles.RowCount = 1;
tableLayoutProfiles.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
tableLayoutProfiles.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
tableLayoutProfiles.Size = new Size(420, 38);
tableLayoutProfiles.Size = new Size(437, 38);
tableLayoutProfiles.TabIndex = 44;
//
// panelBatteryState
@@ -1302,11 +1302,11 @@
buttonSync.BorderRadius = 2;
buttonSync.FlatStyle = FlatStyle.Flat;
buttonSync.ForeColor = SystemColors.ControlText;
buttonSync.Location = new Point(223, 5);
buttonSync.Location = new Point(5, 37);
buttonSync.Margin = new Padding(2, 4, 2, 4);
buttonSync.Name = "buttonSync";
buttonSync.Secondary = false;
buttonSync.Size = new Size(195, 25);
buttonSync.Size = new Size(431, 25);
buttonSync.TabIndex = 46;
buttonSync.Text = "Synchronize with Mouse";
buttonSync.UseVisualStyleBackColor = false;
@@ -1322,7 +1322,7 @@
panelBottomButtons.Location = new Point(7, 731);
panelBottomButtons.Margin = new Padding(2);
panelBottomButtons.Name = "panelBottomButtons";
panelBottomButtons.Size = new Size(420, 45);
panelBottomButtons.Size = new Size(437, 66);
panelBottomButtons.TabIndex = 47;
//
// buttonImport
@@ -1335,11 +1335,11 @@
buttonImport.BorderRadius = 2;
buttonImport.FlatStyle = FlatStyle.Flat;
buttonImport.ForeColor = SystemColors.ControlText;
buttonImport.Location = new Point(106, 6);
buttonImport.Location = new Point(222, 6);
buttonImport.Margin = new Padding(2, 4, 2, 4);
buttonImport.Name = "buttonImport";
buttonImport.Secondary = false;
buttonImport.Size = new Size(102, 25);
buttonImport.Size = new Size(214, 25);
buttonImport.TabIndex = 48;
buttonImport.Text = "Import Profile";
buttonImport.UseVisualStyleBackColor = false;
@@ -1355,11 +1355,11 @@
buttonExport.BorderRadius = 2;
buttonExport.FlatStyle = FlatStyle.Flat;
buttonExport.ForeColor = SystemColors.ControlText;
buttonExport.Location = new Point(2, 6);
buttonExport.Location = new Point(5, 6);
buttonExport.Margin = new Padding(2, 4, 2, 4);
buttonExport.Name = "buttonExport";
buttonExport.Secondary = false;
buttonExport.Size = new Size(103, 25);
buttonExport.Size = new Size(197, 25);
buttonExport.TabIndex = 47;
buttonExport.Text = "Export Profile";
buttonExport.UseVisualStyleBackColor = false;
@@ -1433,7 +1433,7 @@
AutoScroll = true;
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(451, 699);
ClientSize = new Size(451, 803);
Controls.Add(panelBottomButtons);
Controls.Add(panelEnergy);
Controls.Add(panelLighting);

View File

@@ -1,4 +1,5 @@
using System.Runtime.InteropServices;
using GHelper.Helpers;
using System.Management;
namespace GHelper.Display
{
@@ -7,7 +8,6 @@ namespace GHelper.Display
public const int MAX_REFRESH = 1000;
public static DisplayGammaRamp? gammaRamp;
public void AutoScreen(bool force = false)
{
@@ -24,57 +24,6 @@ namespace GHelper.Display
}
}
public void SetBrightness(int brightness = -1)
{
if (!AppConfig.IsOLED()) return;
if (brightness >= 0) AppConfig.Set("brightness", brightness);
else brightness = AppConfig.Get("brightness");
if (brightness >= 0) SetGamma(brightness);
}
public void SetGamma(int brightness = 100)
{
var bright = Math.Round((float)brightness / 200 + 0.5, 2);
var screenName = ScreenNative.FindLaptopScreen();
if (screenName is null) return;
try
{
var handle = ScreenNative.CreateDC(screenName, screenName, null, IntPtr.Zero);
if (gammaRamp is null)
{
var gammaDump = new GammaRamp();
if (ScreenNative.GetDeviceGammaRamp(handle, ref gammaDump))
{
gammaRamp = new DisplayGammaRamp(gammaDump);
//Logger.WriteLine("Gamma R: " + string.Join("-", gammaRamp.Red));
//Logger.WriteLine("Gamma G: " + string.Join("-", gammaRamp.Green));
//Logger.WriteLine("Gamma B: " + string.Join("-", gammaRamp.Blue));
}
}
if (gammaRamp is null || !gammaRamp.IsOriginal())
{
Logger.WriteLine("Not default Gamma");
gammaRamp = new DisplayGammaRamp();
}
var ramp = gammaRamp.AsBrightnessRamp(bright);
bool result = ScreenNative.SetDeviceGammaRamp(handle, ref ramp);
Logger.WriteLine("Brightness " + bright.ToString() + ": " + result);
} catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
}
//ScreenBrightness.Set(60 + (int)(40 * bright));
}
public void SetScreen(int frequency = -1, int overdrive = -1, int miniled = -1)
{
@@ -96,8 +45,8 @@ namespace GHelper.Display
if (overdrive >= 0)
{
if (AppConfig.Get("no_overdrive") == 1) overdrive = 0;
Program.acpi.DeviceSet(AsusACPI.ScreenOverdrive, overdrive, "ScreenOverdrive");
if (AppConfig.IsNoOverdrive()) overdrive = 0;
if (!AppConfig.IsOLED()) Program.acpi.DeviceSet(AsusACPI.ScreenOverdrive, overdrive, "ScreenOverdrive");
}
@@ -149,9 +98,9 @@ namespace GHelper.Display
int maxFrequency = ScreenNative.GetMaxRefreshRate(laptopScreen);
bool screenAuto = AppConfig.Is("screen_auto");
bool overdriveSetting = !AppConfig.Is("no_overdrive");
bool overdriveSetting = !AppConfig.IsNoOverdrive();
int overdrive = Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive);
int overdrive = AppConfig.IsNoOverdrive() ? 0 : Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive);
int miniled1 = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled1);
int miniled2 = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled2);

View File

@@ -0,0 +1,245 @@
using GHelper.Helpers;
using System.Management;
namespace GHelper.Display
{
public enum SplendidGamut : int
{
Native = 50,
sRGB = 51,
DCIP3 = 53,
DisplayP3 = 54
}
public enum SplendidCommand : int
{
Init = 10,
DimmingAsus = 9,
DimmingVisual = 19,
GamutMode = 200,
Default = 11,
Racing = 21,
Scenery = 22,
RTS = 23,
FPS = 24,
Cinema = 25,
Vivid = 13,
Eyecare = 17,
}
public static class VisualControl
{
public static DisplayGammaRamp? gammaRamp;
private static int _brightness = 100;
private static bool _init = true;
private static string? _splendidPath = null;
private static System.Timers.Timer brightnessTimer = new System.Timers.Timer(100);
static VisualControl()
{
brightnessTimer.Elapsed += BrightnessTimerTimer_Elapsed;
}
private static string GetGameVisualPath()
{
return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\ASUS\\GameVisual";
}
public static Dictionary<SplendidGamut, string> GetGamutModes()
{
Dictionary<SplendidGamut, string> _modes = new Dictionary<SplendidGamut, string>();
string gameVisualPath = GetGameVisualPath();
if (!Directory.Exists(gameVisualPath))
{
Logger.WriteLine(gameVisualPath + "doesn't exit");
return _modes;
}
try
{
DirectoryInfo d = new DirectoryInfo(GetGameVisualPath());
FileInfo[] icms = d.GetFiles("*.icm");
if (icms.Length == 0) return _modes;
_modes.Add(SplendidGamut.Native, "Gamut: Native");
foreach (FileInfo icm in icms)
{
if (icm.Name.Contains("sRGB")) _modes.Add(SplendidGamut.sRGB, "Gamut: sRGB");
if (icm.Name.Contains("DCIP3")) _modes.Add(SplendidGamut.DCIP3, "Gamut: DCIP3");
if (icm.Name.Contains("DisplayP3")) _modes.Add(SplendidGamut.DisplayP3, "Gamut: DisplayP3");
}
return _modes;
}
catch
{
return _modes;
}
}
public static Dictionary<SplendidCommand, string> GetVisualModes()
{
return new Dictionary<SplendidCommand, string>
{
{ SplendidCommand.Default, "Default"},
{ SplendidCommand.Racing, "Racing"},
{ SplendidCommand.Scenery, "Scenery"},
{ SplendidCommand.RTS, "RTS/RPG"},
{ SplendidCommand.FPS, "FPS"},
{ SplendidCommand.Cinema, "Cinema"},
{ SplendidCommand.Vivid, "Vivid" },
{ SplendidCommand.Eyecare, "Eyecare"}
};
}
public static void SetGamut(int mode = 50)
{
if (RunSplendid(SplendidCommand.GamutMode, 0, mode)) return;
if (_init)
{
_init = false;
RunSplendid(SplendidCommand.Init);
RunSplendid(SplendidCommand.GamutMode, 0, mode);
}
}
public static void SetVisual(SplendidCommand mode = SplendidCommand.Default, int whiteBalance = 50)
{
int balance = mode == SplendidCommand.Eyecare ? 2 : whiteBalance;
if (RunSplendid(mode, 0, balance)) return;
if (_init)
{
_init = false;
RunSplendid(SplendidCommand.Init);
RunSplendid(mode, 0, balance);
}
}
private static string GetSplendidPath()
{
if (_splendidPath == null)
{
try
{
using (var searcher = new ManagementObjectSearcher(@"Select * from Win32_SystemDriver WHERE Name='ATKWMIACPIIO'"))
{
foreach (var driver in searcher.Get())
{
string path = driver["PathName"].ToString();
_splendidPath = Path.GetDirectoryName(path) + "\\AsusSplendid.exe";
break;
}
}
}
catch (Exception ex)
{
Logger.WriteLine(ex.Message);
}
}
return _splendidPath;
}
private static bool RunSplendid(SplendidCommand command, int? param1 = null, int? param2 = null)
{
var splendid = GetSplendidPath();
bool isGameVisual = Directory.Exists(GetGameVisualPath());
bool isSplenddid = File.Exists(splendid);
if (isSplenddid)
{
if (command == SplendidCommand.DimmingVisual && !isGameVisual) command = SplendidCommand.DimmingAsus;
var result = ProcessHelper.RunCMD(splendid, (int)command + " " + param1 + " " + param2);
if (result.Contains("file not exist") || (result.Length == 0 && isGameVisual)) return false;
}
return true;
}
private static void BrightnessTimerTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
{
brightnessTimer.Stop();
if (RunSplendid(SplendidCommand.DimmingVisual, 0, (int)(40 + _brightness * 0.6))) return;
if (_init)
{
_init = false;
RunSplendid(SplendidCommand.Init);
RunSplendid(SplendidCommand.Init, 4);
if (RunSplendid(SplendidCommand.DimmingVisual, 0, (int)(40 + _brightness * 0.6))) return;
}
// GammaRamp Fallback
SetGamma(_brightness);
}
public static int SetBrightness(int brightness = -1, int delta = 0)
{
if (!AppConfig.IsOLED()) return -1;
if (brightness < 0) brightness = AppConfig.Get("brightness", 100);
_brightness = Math.Max(0, Math.Min(100, brightness + delta));
AppConfig.Set("brightness", _brightness);
brightnessTimer.Start();
Program.settingsForm.VisualiseBrightness();
return _brightness;
}
public static void SetGamma(int brightness = 100)
{
var bright = Math.Round((float)brightness / 200 + 0.5, 2);
var screenName = ScreenNative.FindLaptopScreen();
if (screenName is null) return;
try
{
var handle = ScreenNative.CreateDC(screenName, screenName, null, IntPtr.Zero);
if (gammaRamp is null)
{
var gammaDump = new GammaRamp();
if (ScreenNative.GetDeviceGammaRamp(handle, ref gammaDump))
{
gammaRamp = new DisplayGammaRamp(gammaDump);
//Logger.WriteLine("Gamma R: " + string.Join("-", gammaRamp.Red));
//Logger.WriteLine("Gamma G: " + string.Join("-", gammaRamp.Green));
//Logger.WriteLine("Gamma B: " + string.Join("-", gammaRamp.Blue));
}
}
if (gammaRamp is null || !gammaRamp.IsOriginal())
{
Logger.WriteLine("Not default Gamma");
gammaRamp = new DisplayGammaRamp();
}
var ramp = gammaRamp.AsBrightnessRamp(bright);
bool result = ScreenNative.SetDeviceGammaRamp(handle, ref ramp);
Logger.WriteLine("Gamma " + bright.ToString() + ": " + result);
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
}
//ScreenBrightness.Set(60 + (int)(40 * bright));
}
}
}

View File

@@ -210,6 +210,11 @@ namespace GHelper
checkUSBC.Visible = false;
}
if (AppConfig.IsOLED())
{
checkNoOverdrive.Visible = false;
}
// Change text and hide irrelevant options on the ROG Ally,
// which is a bit of a special case piece of hardware.
if (AppConfig.IsAlly())
@@ -357,7 +362,7 @@ namespace GHelper
checkTopmost.Checked = AppConfig.Is("topmost");
checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ;
checkNoOverdrive.Checked = AppConfig.Is("no_overdrive");
checkNoOverdrive.Checked = AppConfig.IsNoOverdrive();
checkNoOverdrive.CheckedChanged += CheckNoOverdrive_CheckedChanged;
checkUSBC.Checked = AppConfig.Is("optimized_usbc");

View File

@@ -48,7 +48,7 @@ namespace GHelper
labelPowerLimits.Text = Properties.Strings.PowerLimits;
checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
labelFans.Text = Properties.Strings.FanCurves;
labelFans.Text = "BIOS " + Properties.Strings.FanCurves;
labelBoost.Text = Properties.Strings.CPUBoost;
buttonReset.Text = Properties.Strings.FactoryDefaults;
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
@@ -1008,7 +1008,7 @@ namespace GHelper
try
{
if (chartCount > 2)
Size = MinimumSize = new Size(Size.Width, (int)(ControlHelper.GetDpiScale(this).Value * (chartCount * 200 + 100)));
Size = MinimumSize = new Size(Size.Width, Math.Max(MinimumSize.Height, (int)(ControlHelper.GetDpiScale(this).Value * (chartCount * 200 + 100))));
}
catch (Exception ex)
{
@@ -1115,6 +1115,7 @@ namespace GHelper
if (gpuVisible)
{
int gpuPowerVar = Program.acpi.DeviceGet(AsusACPI.GPU_POWER);
Logger.WriteLine("Default GPU Power: " + gpuPowerVar);
trackGPUClockLimit.Value = NvidiaGpuControl.MaxClockLimit;
trackGPUCore.Value = 0;
@@ -1122,7 +1123,7 @@ namespace GHelper
trackGPUBoost.Value = AsusACPI.MaxGPUBoost;
trackGPUTemp.Value = AsusACPI.MaxGPUTemp;
trackGPUPower.Value = (gpuPowerVar >= 0) ? gpuPowerVar : AsusACPI.MaxGPUPower;
trackGPUPower.Value = Math.Max(Math.Min((gpuPowerVar >= 0) ? gpuPowerVar : AsusACPI.MaxGPUPower, AsusACPI.MaxGPUPower), AsusACPI.MinGPUPower);
AppConfig.SetMode("gpu_boost", trackGPUBoost.Value);
AppConfig.SetMode("gpu_temp", trackGPUTemp.Value);

View File

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

View File

@@ -101,8 +101,6 @@ namespace GHelper.Helpers
if (Program.settingsForm.Visible)
Program.screenControl.InitScreen();
Program.screenControl.SetBrightness();
}
private static int CheckAndSaveLidAction()

View File

@@ -122,7 +122,7 @@ namespace GHelper.Helpers
}
}
public static void RunCMD(string name, string args)
public static string RunCMD(string name, string args)
{
var cmd = new Process();
cmd.StartInfo.UseShellExecute = false;
@@ -133,13 +133,13 @@ namespace GHelper.Helpers
cmd.StartInfo.Arguments = args;
cmd.Start();
Logger.WriteLine(args);
Logger.WriteLine(name + " " + args);
string result = cmd.StandardOutput.ReadToEnd().Replace(Environment.NewLine, " ").Trim(' ');
Logger.WriteLine(result);
cmd.WaitForExit();
return result;
}

View File

@@ -85,7 +85,7 @@ namespace GHelper.Input
InitBacklightTimer();
if (AppConfig.ContainsModel("VivoBook")) Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ? 1 : 0, "FnLock");
if (AppConfig.IsVivoZenbook()) Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ? 1 : 0, "FnLock");
}
@@ -151,7 +151,7 @@ namespace GHelper.Input
// FN-Lock group
if (AppConfig.Is("fn_lock") && !AppConfig.ContainsModel("VivoBook"))
if (AppConfig.Is("fn_lock") && !AppConfig.IsVivoZenbook())
for (Keys i = Keys.F1; i <= Keys.F11; i++) hook.RegisterHotKey(ModifierKeys.None, i);
// Arrow-lock group
@@ -244,6 +244,13 @@ namespace GHelper.Input
}
static void SetBrightnessDimming(int delta)
{
int brightness = VisualControl.SetBrightness(delta: delta);
if (brightness >= 0)
Program.toast.RunToast(brightness + "%", (delta < 0) ? ToastIcon.BrightnessDown : ToastIcon.BrightnessUp);
}
public void KeyPressed(object sender, KeyPressedEventArgs e)
{
@@ -500,7 +507,7 @@ namespace GHelper.Input
case "micmute":
bool muteStatus = Audio.ToggleMute();
Program.toast.RunToast(muteStatus ? "Muted" : "Unmuted", muteStatus ? ToastIcon.MicrophoneMute : ToastIcon.Microphone);
if (AppConfig.IsVivobook()) Program.acpi.DeviceSet(AsusACPI.MicMuteLed, muteStatus ? 1 : 0, "MicmuteLed");
if (AppConfig.IsVivoZenbook()) Program.acpi.DeviceSet(AsusACPI.MicMuteLed, muteStatus ? 1 : 0, "MicmuteLed");
break;
case "brightness_up":
SetBrightness(+10);
@@ -568,7 +575,7 @@ namespace GHelper.Input
int fnLock = AppConfig.Is("fn_lock") ? 0 : 1;
AppConfig.Set("fn_lock", fnLock);
if (AppConfig.ContainsModel("VivoBook"))
if (AppConfig.IsVivoZenbook())
Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock == 1 ? 1 : 0, "FnLock");
else
Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys);
@@ -676,7 +683,8 @@ namespace GHelper.Input
return;
case 51: // Fn+F6 on old TUFs
case 53: // Fn+F6 on GA-502DU model
NativeMethods.TurnOffScreen();
SleepEvent();
//NativeMethods.TurnOffScreen();
return;
}
}
@@ -697,8 +705,14 @@ namespace GHelper.Input
if (AppConfig.IsDUO()) SetScreenpad(-10);
else Program.settingsForm.BeginInvoke(Program.settingsForm.CycleMatrix, -1);
}
else if (Control.ModifierKeys == Keys.Control && AppConfig.IsOLED())
{
SetBrightnessDimming(-10);
}
else
{
Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.Brightness_Down, "Brightness");
}
break;
case 32: // FN+F8
if (Control.ModifierKeys == Keys.Shift)
@@ -706,8 +720,14 @@ namespace GHelper.Input
if (AppConfig.IsDUO()) SetScreenpad(10);
else Program.settingsForm.BeginInvoke(Program.settingsForm.CycleMatrix, 1);
}
else if (Control.ModifierKeys == Keys.Control && AppConfig.IsOLED())
{
SetBrightnessDimming(10);
}
else
{
Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.Brightness_Up, "Brightness");
}
break;
case 133: // Camera Toggle
ToggleCamera();

View File

@@ -62,39 +62,45 @@ namespace GHelper.Mode
if (!Modes.Exists(mode)) mode = 0;
customFans = false;
customPower = 0;
settings.ShowMode(mode);
SetModeLabel();
Modes.SetCurrent(mode);
int status = Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.IsManualModeRequired() ? AsusACPI.PerformanceManual : Modes.GetBase(mode), "Mode");
// Vivobook fallback
if (status != 1)
Task.Run(async () =>
{
int vivoMode = Modes.GetBase(mode);
if (vivoMode == 1) vivoMode = 2;
else if (vivoMode == 2) vivoMode = 1;
Program.acpi.DeviceSet(AsusACPI.VivoBookMode, vivoMode, "VivoMode");
}
bool reset = AppConfig.IsResetRequired() && (Modes.GetBase(oldMode) == Modes.GetBase(mode)) && customPower > 0;
customFans = false;
customPower = 0;
SetModeLabel();
// Workaround for not properly resetting limits on G14 2024
if (reset)
{
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, (Modes.GetBase(oldMode) != 1) ? AsusACPI.PerformanceTurbo : AsusACPI.PerformanceBalanced, "Reset");
await Task.Delay(TimeSpan.FromMilliseconds(1500));
}
int status = Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.IsManualModeRequired() ? AsusACPI.PerformanceManual : Modes.GetBase(mode), "Mode");
// Vivobook fallback
if (status != 1) Program.acpi.SetVivoMode(Modes.GetBase(mode));
SetGPUClocks();
AutoFans();
await Task.Delay(TimeSpan.FromMilliseconds(1000));
AutoPower();
});
if (AppConfig.Is("xgm_fan") && Program.acpi.IsXGConnected()) XGM.Reset();
if (notify)
Program.toast.RunToast(Modes.GetCurrentName(), SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online ? ToastIcon.Charger : ToastIcon.Battery);
SetGPUClocks();
Task.Run(async () =>
{
await Task.Delay(TimeSpan.FromMilliseconds(100));
AutoFans();
await Task.Delay(TimeSpan.FromMilliseconds(1000));
AutoPower();
});
// Power plan from config or defaulting to balanced

View File

@@ -37,7 +37,12 @@
}
public override int DPIIncrements()
{
return 100;
return 50;
}
public override int MinDPI()
{
return 50;
}
public override bool HasDebounceSetting()

View File

@@ -7,6 +7,10 @@
{
}
public StrixImpactII(ushort pid) : base(0x0B05, pid, "mi_00", false)
{
}
public override int DPIProfileCount()
{
return 4;
@@ -174,4 +178,19 @@
}
}
}
public class StrixImpactIIElectroPunk : StrixImpactII
{
public StrixImpactIIElectroPunk() : base(0x1956)
{
}
public override string GetDisplayName()
{
return "ROG Strix Impact II Electro Punk";
}
}
}

View File

@@ -209,6 +209,7 @@ namespace GHelper.Peripherals
DetectMouse(new PugioII());
DetectMouse(new PugioIIWired());
DetectMouse(new StrixImpactII());
DetectMouse(new StrixImpactIIElectroPunk());
DetectMouse(new Chakram());
DetectMouse(new ChakramWired());
DetectMouse(new ChakramCore());

View File

@@ -32,7 +32,7 @@ namespace GHelper
public static ModeControl modeControl = new ModeControl();
public static GPUModeControl gpuControl = new GPUModeControl(settingsForm);
public static AllyControl allyControl = new AllyControl(settingsForm);
public static ScreenControl screenControl = new ScreenControl();
public static ScreenControl screenControl = new ScreenControl();
public static ClamshellModeControl clamshellControl = new ClamshellModeControl();
public static ToastForm toast = new ToastForm();

View File

@@ -13,7 +13,7 @@ namespace Ryzen
internal class RyzenControl
{
public static int MinCPUUV => AppConfig.Get("min_uv", -30);
public static int MinCPUUV => AppConfig.Get("min_uv", -40);
public const int MaxCPUUV = 0;
public const int MinIGPUUV = -20;

File diff suppressed because it is too large Load Diff

View File

@@ -123,6 +123,9 @@ namespace GHelper
pictureAlly = new PictureBox();
labelAlly = new Label();
panelGamma = new Panel();
tableVisual = new TableLayoutPanel();
comboVisual = new RComboBox();
comboGamut = new RComboBox();
sliderGamma = new Slider();
panelGammaTitle = new Panel();
labelGamma = new Label();
@@ -168,6 +171,7 @@ namespace GHelper
panelAllyTitle.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureAlly).BeginInit();
panelGamma.SuspendLayout();
tableVisual.SuspendLayout();
panelGammaTitle.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureGamma).BeginInit();
SuspendLayout();
@@ -181,7 +185,7 @@ namespace GHelper
panelMatrix.Controls.Add(tableLayoutMatrix);
panelMatrix.Controls.Add(panelMatrixTitle);
panelMatrix.Dock = DockStyle.Top;
panelMatrix.Location = new Point(11, 950);
panelMatrix.Location = new Point(11, 1000);
panelMatrix.Margin = new Padding(0);
panelMatrix.Name = "panelMatrix";
panelMatrix.Padding = new Padding(20, 20, 20, 10);
@@ -356,7 +360,7 @@ namespace GHelper
panelBattery.Controls.Add(sliderBattery);
panelBattery.Controls.Add(panelBatteryTitle);
panelBattery.Dock = DockStyle.Top;
panelBattery.Location = new Point(11, 1626);
panelBattery.Location = new Point(11, 1676);
panelBattery.Margin = new Padding(0);
panelBattery.Name = "panelBattery";
panelBattery.Padding = new Padding(20, 20, 20, 10);
@@ -448,7 +452,7 @@ namespace GHelper
panelFooter.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelFooter.Controls.Add(tableButtons);
panelFooter.Dock = DockStyle.Top;
panelFooter.Location = new Point(11, 1801);
panelFooter.Location = new Point(11, 1851);
panelFooter.Margin = new Padding(0);
panelFooter.Name = "panelFooter";
panelFooter.Padding = new Padding(20);
@@ -1195,7 +1199,7 @@ namespace GHelper
panelKeyboard.Controls.Add(tableLayoutKeyboard);
panelKeyboard.Controls.Add(panelKeyboardTitle);
panelKeyboard.Dock = DockStyle.Top;
panelKeyboard.Location = new Point(11, 1284);
panelKeyboard.Location = new Point(11, 1334);
panelKeyboard.Margin = new Padding(0);
panelKeyboard.Name = "panelKeyboard";
panelKeyboard.Padding = new Padding(20);
@@ -1371,7 +1375,7 @@ namespace GHelper
panelVersion.Controls.Add(labelCharge);
panelVersion.Controls.Add(checkStartup);
panelVersion.Dock = DockStyle.Top;
panelVersion.Location = new Point(11, 1745);
panelVersion.Location = new Point(11, 1795);
panelVersion.Margin = new Padding(4);
panelVersion.Name = "panelVersion";
panelVersion.Size = new Size(827, 56);
@@ -1396,7 +1400,7 @@ namespace GHelper
panelPeripherals.Controls.Add(tableLayoutPeripherals);
panelPeripherals.Controls.Add(panelPeripheralsTile);
panelPeripherals.Dock = DockStyle.Top;
panelPeripherals.Location = new Point(11, 1428);
panelPeripherals.Location = new Point(11, 1478);
panelPeripherals.Margin = new Padding(0);
panelPeripherals.Name = "panelPeripherals";
panelPeripherals.Padding = new Padding(20, 20, 20, 10);
@@ -1538,7 +1542,7 @@ namespace GHelper
panelAlly.Controls.Add(tableLayoutAlly);
panelAlly.Controls.Add(panelAllyTitle);
panelAlly.Dock = DockStyle.Top;
panelAlly.Location = new Point(11, 1144);
panelAlly.Location = new Point(11, 1194);
panelAlly.Margin = new Padding(0);
panelAlly.Name = "panelAlly";
panelAlly.Padding = new Padding(20, 20, 20, 0);
@@ -1670,6 +1674,7 @@ namespace GHelper
//
panelGamma.AutoSize = true;
panelGamma.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelGamma.Controls.Add(tableVisual);
panelGamma.Controls.Add(sliderGamma);
panelGamma.Controls.Add(panelGammaTitle);
panelGamma.Dock = DockStyle.Top;
@@ -1677,23 +1682,78 @@ namespace GHelper
panelGamma.Margin = new Padding(0);
panelGamma.Name = "panelGamma";
panelGamma.Padding = new Padding(20, 20, 20, 10);
panelGamma.Size = new Size(827, 123);
panelGamma.Size = new Size(827, 173);
panelGamma.TabIndex = 9;
panelGamma.Visible = false;
//
// tableVisual
//
tableVisual.AutoSize = true;
tableVisual.AutoSizeMode = AutoSizeMode.GrowAndShrink;
tableVisual.ColumnCount = 3;
tableVisual.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
tableVisual.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
tableVisual.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
tableVisual.Controls.Add(comboVisual, 0, 0);
tableVisual.Controls.Add(comboGamut, 0, 0);
tableVisual.Dock = DockStyle.Top;
tableVisual.Location = new Point(20, 104);
tableVisual.Margin = new Padding(8);
tableVisual.Name = "tableVisual";
tableVisual.RowCount = 1;
tableVisual.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
tableVisual.Size = new Size(787, 59);
tableVisual.TabIndex = 41;
tableVisual.Visible = false;
//
// comboVisual
//
comboVisual.BorderColor = Color.White;
comboVisual.ButtonColor = Color.FromArgb(255, 255, 255);
comboVisual.Dock = DockStyle.Top;
comboVisual.FlatStyle = FlatStyle.Flat;
comboVisual.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
comboVisual.FormattingEnabled = true;
comboVisual.ItemHeight = 32;
comboVisual.Items.AddRange(new object[] { "Static", "Breathe", "Rainbow", "Strobe" });
comboVisual.Location = new Point(266, 11);
comboVisual.Margin = new Padding(4, 11, 4, 8);
comboVisual.Name = "comboVisual";
comboVisual.Size = new Size(254, 40);
comboVisual.TabIndex = 14;
comboVisual.Visible = false;
//
// comboGamut
//
comboGamut.BorderColor = Color.White;
comboGamut.ButtonColor = Color.FromArgb(255, 255, 255);
comboGamut.Dock = DockStyle.Top;
comboGamut.FlatStyle = FlatStyle.Flat;
comboGamut.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
comboGamut.FormattingEnabled = true;
comboGamut.ItemHeight = 32;
comboGamut.Items.AddRange(new object[] { "Static", "Breathe", "Rainbow", "Strobe" });
comboGamut.Location = new Point(4, 11);
comboGamut.Margin = new Padding(4, 11, 4, 8);
comboGamut.Name = "comboGamut";
comboGamut.Size = new Size(254, 40);
comboGamut.TabIndex = 13;
comboGamut.Visible = false;
//
// sliderGamma
//
sliderGamma.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
sliderGamma.Location = new Point(40, 69);
sliderGamma.Dock = DockStyle.Top;
sliderGamma.Location = new Point(20, 64);
sliderGamma.Margin = new Padding(4);
sliderGamma.Max = 100;
sliderGamma.Min = 0;
sliderGamma.Name = "sliderGamma";
sliderGamma.Size = new Size(752, 40);
sliderGamma.Size = new Size(787, 40);
sliderGamma.Step = 10;
sliderGamma.TabIndex = 20;
sliderGamma.Text = "sliderGamma";
sliderGamma.Value = 100;
sliderGamma.Visible = false;
//
// panelGammaTitle
//
@@ -1736,7 +1796,7 @@ namespace GHelper
labelGammaTitle.Location = new Point(43, 0);
labelGammaTitle.Margin = new Padding(8, 0, 8, 0);
labelGammaTitle.Name = "labelGammaTitle";
labelGammaTitle.Size = new Size(307, 32);
labelGammaTitle.Size = new Size(506, 32);
labelGammaTitle.TabIndex = 37;
labelGammaTitle.Text = "Flicker-free Dimming";
//
@@ -1746,7 +1806,7 @@ namespace GHelper
AutoScaleMode = AutoScaleMode.Dpi;
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(849, 2119);
ClientSize = new Size(849, 1759);
Controls.Add(panelFooter);
Controls.Add(panelVersion);
Controls.Add(panelBattery);
@@ -1826,6 +1886,8 @@ namespace GHelper
panelAllyTitle.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureAlly).EndInit();
panelGamma.ResumeLayout(false);
panelGamma.PerformLayout();
tableVisual.ResumeLayout(false);
panelGammaTitle.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)pictureGamma).EndInit();
ResumeLayout(false);
@@ -1931,5 +1993,8 @@ namespace GHelper
private Label labelGammaTitle;
private CheckBox checkMatrixLid;
private Panel panelMatrixAuto;
private TableLayoutPanel tableVisual;
private RComboBox comboVisual;
private RComboBox comboGamut;
}
}

View File

@@ -24,7 +24,7 @@ namespace GHelper
public GPUModeControl gpuControl;
public AllyControl allyControl;
ScreenControl screenControl = new ScreenControl();
ScreenControl screenControl = new ScreenControl();
AutoUpdateControl updateControl;
AsusMouseSettings? mouseSettings;
@@ -48,6 +48,8 @@ namespace GHelper
bool batteryMouseOver = false;
bool batteryFullMouseOver = false;
bool sliderGammaIgnore = false;
public SettingsForm()
{
@@ -116,7 +118,7 @@ namespace GHelper
buttonScreenAuto.AccessibleName = Properties.Strings.AutoMode;
//button60Hz.AccessibleName = "60Hz Refresh Rate";
//button120Hz.AccessibleName = "Maximum Refresh Rate";
panelKeyboard.AccessibleName = Properties.Strings.LaptopKeyboard;
buttonKeyboard.AccessibleName = Properties.Strings.ExtraSettings;
buttonKeyboardColor.AccessibleName = Properties.Strings.LaptopKeyboard + " " + Properties.Strings.Color;
@@ -219,7 +221,7 @@ namespace GHelper
sliderBattery.ValueChanged += SliderBattery_ValueChanged;
Program.trayIcon.MouseMove += TrayIcon_MouseMove;
sensorTimer = new System.Timers.Timer(AppConfig.Get("sensor_timer",1000));
sensorTimer = new System.Timers.Timer(AppConfig.Get("sensor_timer", 1000));
sensorTimer.Elapsed += OnTimedEvent;
sensorTimer.Enabled = true;
@@ -255,28 +257,83 @@ namespace GHelper
buttonFnLock.Click += ButtonFnLock_Click;
panelPerformance.Focus();
InitBrightness();
InitVisual();
}
public void InitBrightness()
public void InitVisual()
{
if (!AppConfig.IsOLED()) return;
bool dimming = false;
if (AppConfig.IsOLED())
{
dimming = true;
labelGammaTitle.Text = "Flicker-free Dimming";
panelGamma.Visible = true;
sliderGamma.Visible = true;
VisualiseBrightness();
sliderGamma.ValueChanged += SliderGamma_ValueChanged;
}
var gamuts = VisualControl.GetGamutModes();
if (gamuts.Count < 1) return;
if (!dimming) labelGammaTitle.Text = "Visual Mode";
else labelGammaTitle.Text += " / Visual";
panelGamma.Visible = true;
tableVisual.Visible = true;
int brightness = AppConfig.Get("brightness");
if (brightness >= 0) sliderGamma.Value = brightness;
comboVisual.DropDownStyle = ComboBoxStyle.DropDownList;
comboVisual.DataSource = new BindingSource(VisualControl.GetVisualModes(), null);
comboVisual.DisplayMember = "Value";
comboVisual.ValueMember = "Key";
comboVisual.SelectedValue = (SplendidCommand)AppConfig.Get("visual", (int)SplendidCommand.Default);
comboVisual.SelectedValueChanged += ComboVisual_SelectedValueChanged;
comboVisual.Visible = true;
if (gamuts.Count <= 1) return;
comboGamut.DropDownStyle = ComboBoxStyle.DropDownList;
comboGamut.DataSource = new BindingSource(gamuts, null);
comboGamut.DisplayMember = "Value";
comboGamut.ValueMember = "Key";
comboGamut.SelectedValue = (SplendidGamut)AppConfig.Get("gamut", (int)SplendidGamut.Native);
comboGamut.SelectedValueChanged += ComboGamut_SelectedValueChanged;
comboGamut.Visible = true;
sliderGamma.ValueChanged += SliderGamma_ValueChanged;
labelGamma.Text = sliderGamma.Value + "%";
}
private void ComboGamut_SelectedValueChanged(object? sender, EventArgs e)
{
AppConfig.Set("gamut", (int)comboGamut.SelectedValue);
VisualControl.SetGamut((int)comboGamut.SelectedValue);
}
private void ComboVisual_SelectedValueChanged(object? sender, EventArgs e)
{
AppConfig.Set("visual", (int)comboVisual.SelectedValue);
VisualControl.SetVisual((SplendidCommand)comboVisual.SelectedValue);
}
public void VisualiseBrightness()
{
Invoke(delegate
{
sliderGammaIgnore = true;
sliderGamma.Value = AppConfig.Get("brightness", 100);
labelGamma.Text = sliderGamma.Value + "%";
sliderGammaIgnore = false;
});
}
private void SliderGamma_ValueChanged(object? sender, EventArgs e)
{
screenControl.SetBrightness(sliderGamma.Value);
labelGamma.Text = sliderGamma.Value + "%";
if (sliderGammaIgnore) return;
VisualControl.SetBrightness(sliderGamma.Value);
}
private void ButtonOverlay_Click(object? sender, EventArgs e)
@@ -350,7 +407,7 @@ namespace GHelper
public void VisualiseBacklight(int backlight)
{
buttonBacklight.Text = Math.Round((double)backlight*33.33).ToString() + "%";
buttonBacklight.Text = Math.Round((double)backlight * 33.33).ToString() + "%";
}
public void VisualiseFPSLimit(int limit)
@@ -847,7 +904,7 @@ namespace GHelper
FansToggle();
}
private void SetColorPicker(string colorField = "aura_color")
private void SetColorPicker(string colorField = "aura_color")
{
ColorDialog colorDlg = new ColorDialog();
colorDlg.AllowFullOpen = true;
@@ -952,7 +1009,7 @@ namespace GHelper
buttonMatrix.Visible = false;
checkMatrixLid.Visible = true;
}
}
comboMatrix.SelectedIndex = Math.Min(AppConfig.Get("matrix_brightness", 0), comboMatrix.Items.Count - 1);
comboMatrixRunning.SelectedIndex = Math.Min(AppConfig.Get("matrix_running", 0), comboMatrixRunning.Items.Count - 1);
@@ -1285,11 +1342,13 @@ namespace GHelper
{
if (InvokeRequired)
{
Invoke(delegate {
Invoke(delegate
{
labelPerf.Text = modeText;
panelPerformance.AccessibleName = labelPerf.Text;
});
} else
}
else
{
labelPerf.Text = modeText;
panelPerformance.AccessibleName = labelPerf.Text;
@@ -1464,7 +1523,7 @@ namespace GHelper
break;
}
VisualizeXGM(GPUMode);
@@ -1638,7 +1697,7 @@ namespace GHelper
return;
}
mouseSettings = new AsusMouseSettings(am);
mouseSettings.TopMost = true;
mouseSettings.TopMost = AppConfig.Is("topmost");
mouseSettings.FormClosed += MouseSettings_FormClosed;
mouseSettings.Disposed += MouseSettings_Disposed;
if (!mouseSettings.IsDisposed)

View File

@@ -97,16 +97,16 @@ public static class AsusHid
try
{
stream.Write(data);
Logger.WriteLine($"{log} {device.ProductID.ToString("X")}: {BitConverter.ToString(data)}");
if (log is not null) Logger.WriteLine($"{log} {device.ProductID.ToString("X")}: {BitConverter.ToString(data)}");
}
catch (Exception ex)
{
Logger.WriteLine($"Error writing {log} {device.ProductID.ToString("X")}: {ex.Message} {BitConverter.ToString(data)} ");
if (log is not null) Logger.WriteLine($"Error writing {log} {device.ProductID.ToString("X")}: {ex.Message} {BitConverter.ToString(data)} ");
}
}
catch (Exception ex)
{
Logger.WriteLine($"Error opening {log} {device.ProductID.ToString("X")}: {ex.Message}");
if (log is not null) Logger.WriteLine($"Error opening {log} {device.ProductID.ToString("X")}: {ex.Message}");
}
}

View File

@@ -79,7 +79,7 @@ namespace GHelper.USB
public static Color Color1 = Color.White;
public static Color Color2 = Color.Black;
static bool isACPI = AppConfig.IsTUF() || AppConfig.IsVivobook() || AppConfig.IsProArt();
static bool isACPI = AppConfig.IsTUF() || AppConfig.IsVivoZenbook() || AppConfig.IsProArt();
static bool isStrix = AppConfig.IsStrix() && !AppConfig.IsNoDirectRGB();
static bool isStrix4Zone = AppConfig.IsStrixLimitedRGB();
@@ -598,7 +598,7 @@ namespace GHelper.USB
if (AppConfig.IsNoDirectRGB())
{
AsusHid.Write(new List<byte[]> { AuraMessage(AuraMode.AuraStatic, color, color, 0xeb, isSingleColor), MESSAGE_SET });
AsusHid.Write(new List<byte[]> { AuraMessage(AuraMode.AuraStatic, color, color, 0xeb, isSingleColor), MESSAGE_SET }, null);
return;
}
@@ -670,7 +670,7 @@ namespace GHelper.USB
{
CustomRGB.ApplyAmbient(true);
timer.Enabled = true;
timer.Interval = AppConfig.Get("aura_refresh", AppConfig.ContainsModel("GU604") ? 400 : 120);
timer.Interval = AppConfig.Get("aura_refresh", AppConfig.IsStrix() ? 100 : 300);
return;
}

View File

@@ -1,5 +1,5 @@
{
"sdk": {
"version": "7.0.400"
"version": "7.0.406"
}
}