Skip to content

Commit

Permalink
slight optimization of Inputs Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed Oct 21, 2022
1 parent 982895c commit d1ebfd3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions HandheldCompanion/Managers/InputsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ private static void M_GlobalHook_KeyEvent(object? sender, KeyEventArgs e)

// leave if inputs are too close
if (unexpected)
break;
return;

LogManager.LogDebug("KeyEvent: {0} at {1}, down: {2}, up: {3}", pair.name, args.Timestamp, args.IsKeyDown, args.IsKeyUp);

Expand All @@ -306,12 +306,9 @@ private static void M_GlobalHook_KeyEvent(object? sender, KeyEventArgs e)
// update vars
inputsChord.SpecialKey = pair.name;
inputsChord.InputsType = InputsChordType.Click;

return;
}

// Sequence was intercepted already
if (InputsChordHoldTimer.IsRunning())
else if (InputsChordHoldTimer.IsRunning())
ExecuteSequence();

return; // prevent multiple shortcuts from being triggered
Expand Down

0 comments on commit d1ebfd3

Please sign in to comment.