mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Input listener fix https://github.com/seerge/g-helper/issues/1924
This commit is contained in:
@@ -12,7 +12,7 @@ namespace GHelper.Input
|
||||
public KeyboardListener(Action<int> KeyHandler)
|
||||
{
|
||||
_handler = KeyHandler;
|
||||
Listen();
|
||||
var task = Task.Run(Listen);
|
||||
}
|
||||
|
||||
private void Listen () {
|
||||
@@ -23,10 +23,10 @@ namespace GHelper.Input
|
||||
|
||||
int count = 0;
|
||||
|
||||
while (input == null && count++ < 60)
|
||||
while (input == null && count++ < 5)
|
||||
{
|
||||
Aura.Init();
|
||||
Thread.Sleep(1000);
|
||||
Thread.Sleep(2000);
|
||||
input = AsusHid.FindHidStream(AsusHid.INPUT_ID);
|
||||
}
|
||||
|
||||
@@ -38,8 +38,6 @@ namespace GHelper.Input
|
||||
|
||||
Logger.WriteLine($"Input: {input.Device.DevicePath}");
|
||||
|
||||
var task = Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
while (!cancellationTokenSource.Token.IsCancellationRequested)
|
||||
@@ -69,8 +67,6 @@ namespace GHelper.Input
|
||||
{
|
||||
Logger.WriteLine(ex.ToString());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user