From 9d130ca540b44e8ebe939a140e6821e15695c3b6 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:00:22 +0100 Subject: [PATCH] Prevent double hotkey processing in some situations https://github.com/seerge/g-helper/issues/3348 --- app/Input/KeyboardListener.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Input/KeyboardListener.cs b/app/Input/KeyboardListener.cs index 99169107..534e09a4 100644 --- a/app/Input/KeyboardListener.cs +++ b/app/Input/KeyboardListener.cs @@ -56,6 +56,7 @@ private void Listen() input.ReadTimeout = int.MaxValue; var data = input.Read(); + if (cancellationTokenSource.Token.IsCancellationRequested) break; if (data.Length > 1 && data[0] == AsusHid.INPUT_ID && data[1] > 0 && data[1] != 236) { Logger.WriteLine($"Key: {data[1]}");