Tweaks and fixes

This commit is contained in:
Serge
2023-05-24 14:34:43 +02:00
parent f395c706f6
commit e765b4f037
9 changed files with 152 additions and 96 deletions

View File

@@ -1,6 +1,7 @@
using System.Text.RegularExpressions;
using System.Text;
using System.Diagnostics;
using Microsoft.Win32;
namespace GHelper
{
@@ -40,6 +41,25 @@ namespace GHelper
return (Process.GetProcessesByName("AsusOptimization").Count() > 0);
}
public static void SetBacklightOffDelay(int value = 60)
{
try
{
RegistryKey myKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ASUS\ASUS System Control Interface\AsusOptimization\ASUS Keyboard Hotkeys", true);
if (myKey != null)
{
myKey.SetValue("TurnOffKeybdLight", value, RegistryValueKind.DWord);
myKey.Close();
}
}
catch (Exception ex)
{
Logger.WriteLine(ex.Message);
}
}
}
}