Skip to content

Commit 1321b2e

Browse files
committed
Init Screenpad brightness on start #3301
1 parent 5e96e3e commit 1321b2e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

app/Input/InputDispatcher.cs

+7
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,13 @@ public static void SetScreenpad(int delta)
10261026
Program.toast.RunToast($"Screen Pad {toast}", delta > 0 ? ToastIcon.BrightnessUp : ToastIcon.BrightnessDown);
10271027
}
10281028

1029+
public static void InitScreenpad()
1030+
{
1031+
if (!AppConfig.IsDUO()) return;
1032+
int brightness = AppConfig.Get("screenpad");
1033+
if (brightness >= 0) ApplyScreenpadAction(brightness);
1034+
}
1035+
10291036
static void LaunchProcess(string command = "")
10301037
{
10311038
if (string.IsNullOrEmpty(command)) return;

app/Program.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,12 @@ public static bool SetAutoModes(bool powerChanged = false, bool init = false)
231231
Logger.WriteLine("AutoSetting for " + isPlugged.ToString());
232232

233233
BatteryControl.AutoBattery(init);
234-
if (init) screenControl.InitMiniled();
234+
235+
if (init)
236+
{
237+
screenControl.InitMiniled();
238+
InputDispatcher.InitScreenpad();
239+
}
235240

236241
inputDispatcher.Init();
237242

0 commit comments

Comments
 (0)