Skip to content

Commit

Permalink
fix overlay trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed May 2, 2022
1 parent d2a19ee commit e72e33b
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions HandheldCompanion/Views/Windows/Overlay.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,22 +308,26 @@ private void UpdateReport(object? sender, EventArgs e)
}

// Handle triggers
if ((Gamepad.Buttons & mainTrigger) != 0)
if (Gamepad.Buttons.HasFlag(mainTrigger))
{
if (!isTriggered)
if (Gamepad.Buttons.HasFlag(controllerTrigger) && !isTriggered)
{
UpdateControllerVisibility();
UpdateVisibility();
isTriggered = true;

if (Gamepad.Buttons.HasFlag(controllerTrigger))
UpdateControllerVisibility();
if (Gamepad.Buttons.HasFlag(trackpadTrigger))
UpdateTrackpadsVisibility();

}

if (Gamepad.Buttons.HasFlag(trackpadTrigger) && !isTriggered)
{
UpdateTrackpadsVisibility();
UpdateVisibility();
isTriggered = true;
}
}
else if (isTriggered)
{
isTriggered = false;
}

// handle triggers update
if (ControllerTriggerListening && Gamepad.Buttons != 0)
Expand Down

0 comments on commit e72e33b

Please sign in to comment.