mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Keyboard listener retry
This commit is contained in:
@@ -12,7 +12,7 @@ namespace GHelper.Input
|
||||
public class InputDispatcher
|
||||
{
|
||||
System.Timers.Timer timer = new System.Timers.Timer(1000);
|
||||
public bool backlightActivity = true;
|
||||
public static bool backlightActivity = true;
|
||||
|
||||
public static Keys keyProfile = Keys.F5;
|
||||
public static Keys keyApp = Keys.F12;
|
||||
@@ -342,6 +342,7 @@ namespace GHelper.Input
|
||||
|
||||
public static void TabletMode()
|
||||
{
|
||||
|
||||
bool touchpadState = GetTouchpadState();
|
||||
bool tabletState = Program.acpi.DeviceGet(AsusACPI.TabletState) > 0;
|
||||
|
||||
|
||||
@@ -10,7 +10,20 @@ namespace GHelper.Input
|
||||
public KeyboardListener(Action<int> KeyHandler)
|
||||
{
|
||||
HidDevice? input = AsusUSB.GetDevice();
|
||||
if (input == null) return;
|
||||
|
||||
// Fallback
|
||||
if (input == null)
|
||||
{
|
||||
AsusUSB.Init();
|
||||
Thread.Sleep(1000);
|
||||
input = AsusUSB.GetDevice();
|
||||
}
|
||||
|
||||
if (input == null)
|
||||
{
|
||||
Logger.WriteLine($"Input device not found");
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.WriteLine($"Input: {input.DevicePath}");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user