mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Add support for CameraShutter (#3358)
This commit is contained in:
@@ -698,10 +698,15 @@ 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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ public class AsusACPI
|
|||||||
public const int ScreenPadToggle = 0x00050031;
|
public const int ScreenPadToggle = 0x00050031;
|
||||||
public const int ScreenPadBrightness = 0x00050032;
|
public const int ScreenPadBrightness = 0x00050032;
|
||||||
|
|
||||||
|
public const int CameraShutter = 0x00060078;
|
||||||
public const int CameraLed = 0x00060079;
|
public const int CameraLed = 0x00060079;
|
||||||
public const int StatusLed = 0x000600C2;
|
public const int StatusLed = 0x000600C2;
|
||||||
|
|
||||||
|
|||||||
@@ -943,6 +943,22 @@ namespace GHelper.Input
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void ToggleCamera()
|
public static void ToggleCamera()
|
||||||
|
{
|
||||||
|
if(AppConfig.IsCameraShutter())
|
||||||
|
{
|
||||||
|
if(Program.acpi.DeviceGet(AsusACPI.CameraShutter)==0)
|
||||||
|
{
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.CameraShutter, 1, "CameraShutterOn");
|
||||||
|
Program.toast.RunToast($"Camera Off");
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.CameraShutter, 0, "CameraShutterOff");
|
||||||
|
Program.toast.RunToast($"Camera On");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (!ProcessHelper.IsUserAdministrator()) return;
|
if (!ProcessHelper.IsUserAdministrator()) return;
|
||||||
|
|
||||||
@@ -970,7 +986,7 @@ namespace GHelper.Input
|
|||||||
{
|
{
|
||||||
Logger.WriteLine(ex.ToString());
|
Logger.WriteLine(ex.ToString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static System.Threading.Timer screenpadActionTimer;
|
private static System.Threading.Timer screenpadActionTimer;
|
||||||
|
|||||||
Reference in New Issue
Block a user