CameraShutter cleanup

This commit is contained in:
Serge
2024-11-10 19:42:39 +01:00
parent 000162b989
commit c6ea0b0e3e
2 changed files with 13 additions and 20 deletions

View File

@@ -698,11 +698,6 @@ public static class AppConfig
{ {
return ContainsModel("G834JYR") || ContainsModel("G834JZR") || Is("force_miniled"); return ContainsModel("G834JYR") || ContainsModel("G834JZR") || Is("force_miniled");
} }
public static bool IsCameraShutter()
{
return ContainsModel("UX5401") || ContainsModel("UX5406");
}
public static bool SaveDimming() public static bool SaveDimming()
{ {
return Is("save_dimming"); return Is("save_dimming");

View File

@@ -427,7 +427,7 @@ namespace GHelper.Input
if (e.Modifier == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt)) if (e.Modifier == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt))
{ {
if (e.Key == keyProfile) modeControl.CyclePerformanceMode(true); if (e.Key == keyProfile) modeControl.CyclePerformanceMode(true);
if (e.Key == keyProfile0) modeControl.SetPerformanceMode(0, true); if (e.Key == keyProfile0) modeControl.SetPerformanceMode(0, true);
if (e.Key == keyProfile1) modeControl.SetPerformanceMode(1, true); if (e.Key == keyProfile1) modeControl.SetPerformanceMode(1, true);
if (e.Key == keyProfile2) modeControl.SetPerformanceMode(2, true); if (e.Key == keyProfile2) modeControl.SetPerformanceMode(2, true);
@@ -664,7 +664,7 @@ namespace GHelper.Input
bool fnLock = !AppConfig.Is("fn_lock"); bool fnLock = !AppConfig.Is("fn_lock");
AppConfig.Set("fn_lock", fnLock ? 1 : 0); AppConfig.Set("fn_lock", fnLock ? 1 : 0);
if (AppConfig.IsHardwareFnLock()) if (AppConfig.IsHardwareFnLock())
HardwareFnLock(fnLock); HardwareFnLock(fnLock);
else else
Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys); Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys);
@@ -944,19 +944,17 @@ namespace GHelper.Input
public static void ToggleCamera() public static void ToggleCamera()
{ {
if(AppConfig.IsCameraShutter()) int cameraShutter = Program.acpi.DeviceGet(AsusACPI.CameraShutter);
{
if(Program.acpi.DeviceGet(AsusACPI.CameraShutter)==0)
{
Program.acpi.DeviceSet(AsusACPI.CameraShutter, 1, "CameraShutterOn");
Program.toast.RunToast($"Camera Off");
} if (cameraShutter == 0)
else {
{ Program.acpi.DeviceSet(AsusACPI.CameraShutter, 1, "CameraShutterOn");
Program.acpi.DeviceSet(AsusACPI.CameraShutter, 0, "CameraShutterOff"); Program.toast.RunToast($"Camera Off");
Program.toast.RunToast($"Camera On"); }
} else if (cameraShutter == 1)
{
Program.acpi.DeviceSet(AsusACPI.CameraShutter, 0, "CameraShutterOff");
Program.toast.RunToast($"Camera On");
} }
else else
{ {
@@ -1004,7 +1002,7 @@ namespace GHelper.Input
if (b < 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 0, "ScreenpadOff"); if (b < 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 0, "ScreenpadOff");
}; };
if(delay <= 0 || instant) //instant action if (delay <= 0 || instant) //instant action
{ {
action(brightness); action(brightness);
} }