mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Slash Lighting tweaks https://github.com/seerge/g-helper/issues/2381
This commit is contained in:
@@ -117,7 +117,12 @@ namespace GHelper.AnimeMatrix
|
||||
public void SetLidMode(bool force = false)
|
||||
{
|
||||
bool matrixLid = AppConfig.Is("matrix_lid");
|
||||
if (deviceSlash is not null) deviceSlash.SetLidMode(matrixLid);
|
||||
|
||||
if (deviceSlash is not null)
|
||||
{
|
||||
deviceSlash.SetLidMode(matrixLid);
|
||||
deviceSlash.SetSleepActive(!matrixLid);
|
||||
}
|
||||
|
||||
if (matrixLid || force)
|
||||
{
|
||||
|
||||
@@ -137,12 +137,18 @@ namespace GHelper.AnimeMatrix
|
||||
|
||||
public void SetBatterySaver(bool status)
|
||||
{
|
||||
Set(Packet<SlashPacket>(0xD8, 0x01, 0x00, 0x01, status ? (byte)0x80 : (byte)0x00), "SlashBatterySaver");
|
||||
Set(Packet<SlashPacket>(0xD8, 0x01, 0x00, 0x01, status ? (byte)0x80 : (byte)0x00), $"SlashBatterySaver {status}");
|
||||
}
|
||||
|
||||
public void SetLidMode(bool status)
|
||||
{
|
||||
Set(Packet<SlashPacket>(0xD8, 0x00, 0x00, 0x02, 0xA5, status ? (byte)0x80 : (byte)0x00));
|
||||
Set(Packet<SlashPacket>(0xD8, 0x00, 0x00, 0x02, 0xA5, status ? (byte)0x80 : (byte)0x00), $"DisableLidClose {status}");
|
||||
}
|
||||
|
||||
public void SetSleepActive(bool status)
|
||||
{
|
||||
Set(Packet<SlashPacket>(0xD2, 0x02, 0x01, 0x08, 0xA1), "SleepInit");
|
||||
Set(Packet<SlashPacket>(0xD3, 0x03, 0x01, 0x08, 0xA1, 0x00, 0xFF, status ? (byte)0x01 : (byte)0x00, 0x02, 0xFF, 0xFF), $"Sleep {status}");
|
||||
}
|
||||
|
||||
public void Set(Packet packet, string? log = null)
|
||||
|
||||
@@ -866,13 +866,22 @@ namespace GHelper
|
||||
|
||||
private void VisualizeCurrentDPIProfile()
|
||||
{
|
||||
if (mouse.DpiProfile > mouse.DpiSettings.Count())
|
||||
if (mouse.DpiProfile > mouse.DpiSettings.Length)
|
||||
{
|
||||
Logger.WriteLine($"Wrong mouse DPI: {mouse.DpiProfile}");
|
||||
return;
|
||||
}
|
||||
|
||||
AsusMouseDPI dpi = mouse.DpiSettings[mouse.DpiProfile - 1];
|
||||
AsusMouseDPI dpi;
|
||||
|
||||
try
|
||||
{
|
||||
dpi = mouse.DpiSettings[mouse.DpiProfile - 1];
|
||||
} catch (Exception ex)
|
||||
{
|
||||
Logger.WriteLine($"Wrong mouse DPI: {mouse.DpiProfile} {mouse.DpiSettings.Length} {ex.Message}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (dpi is null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user