Brightness hotkeys fix

This commit is contained in:
Serge
2023-07-15 13:11:38 +02:00
parent e5f0d77d05
commit 152a4e04c5
2 changed files with 8 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
namespace GHelper.Helpers namespace GHelper.Display
{ {
using System; using System;
using System.Diagnostics; using System.Diagnostics;

View File

@@ -138,6 +138,11 @@ namespace GHelper.Input
} }
static bool IsManualBrightness()
{
return AppConfig.ContainsModel("TUF") && !AppConfig.ContainsModel("FA506");
}
public void KeyPressed(object sender, KeyPressedEventArgs e) public void KeyPressed(object sender, KeyPressedEventArgs e)
{ {
@@ -209,11 +214,11 @@ namespace GHelper.Input
KeyboardHook.KeyPress(Keys.Snapshot); KeyboardHook.KeyPress(Keys.Snapshot);
break; break;
case Keys.F7: case Keys.F7:
//if (AppConfig.ContainsModel("TUF")) Program.toast.RunToast(ScreenBrightness.Adjust(-10) + "%", ToastIcon.BrightnessDown); if (IsManualBrightness()) Program.toast.RunToast(ScreenBrightness.Adjust(-10) + "%", ToastIcon.BrightnessDown);
HandleOptimizationEvent(16); HandleOptimizationEvent(16);
break; break;
case Keys.F8: case Keys.F8:
// if (AppConfig.ContainsModel("TUF")) Program.toast.RunToast(ScreenBrightness.Adjust(+10) + "%", ToastIcon.BrightnessUp); if (IsManualBrightness()) Program.toast.RunToast(ScreenBrightness.Adjust(+10) + "%", ToastIcon.BrightnessUp);
HandleOptimizationEvent(32); HandleOptimizationEvent(32);
break; break;
case Keys.F9: case Keys.F9: