Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly disable OOBE mode #3169

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions app/AsusACPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public class AsusACPI
public const int APU_MEM = 0x000600C1;

public const int TUF_KB_BRIGHTNESS = 0x00050021;
public const int VIVO_KB_BRIGHTNESS = 0x0005002F;
public const int KBD_BACKLIGHT_OOBE = 0x0005002F;

public const int TUF_KB = 0x00100056;
public const int TUF_KB2 = 0x0010005a;
Expand Down Expand Up @@ -417,6 +417,14 @@ public int DeviceGet(uint DeviceID)

}

public bool DevicePresent(uint DeviceID) {
byte[] args = new byte[8];
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
byte[] status = CallMethod(DSTS, args);

return (BitConverter.ToUInt32(status, 0) & 0x10000) == 0x10000;
}

public byte[] DeviceGetBuffer(uint DeviceID, uint Status = 0)
{
byte[] args = new byte[8];
Expand Down Expand Up @@ -784,12 +792,18 @@ public string ScanRange()

}

public void DisableOOBE()
{
if (DevicePresent(KBD_BACKLIGHT_OOBE))
{
DeviceSet(KBD_BACKLIGHT_OOBE, 1, "OOBE");
}
}

public void TUFKeyboardBrightness(int brightness)
{
int param = 0x80 | (brightness & 0x7F);
DeviceSet(TUF_KB_BRIGHTNESS, param, "TUF Brightness");
if (AppConfig.IsVivoZenPro()) DeviceSet(VIVO_KB_BRIGHTNESS, param, "VIVO Brightness");

}

public void TUFKeyboardRGB(AuraMode mode, Color color, int speed, string? log = "TUF RGB")
Expand Down
5 changes: 5 additions & 0 deletions app/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public static void Main(string[] args)
return;
}

if (acpi.IsConnected())
{
acpi.DisableOOBE();
}

ProcessHelper.KillByName("ASUSSmartDisplayControl");

Application.EnableVisualStyles();
Expand Down