Skip to content

Commit

Permalink
POV buttons are handled like other buttons now (allows inherited maps)
Browse files Browse the repository at this point in the history
  • Loading branch information
joekolodz committed Mar 31, 2024
1 parent 8fe7630 commit 0682564
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Models/HOTASQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ private async Task HandlePovButton(JoystickOffset offset, int value)
var success = _lastPovButton.TryRemove(offset, out var translatedOffset);

if (!success) return;
if (!(GetMap(translatedOffset) is HOTASButton map)) return;
HandleButtonReleased(map, translatedOffset);
OnButtonRelease(translatedOffset);

await HandleStandardButton(translatedOffset, (int)JoystickOffsetValues.ButtonState.ButtonReleased);
}
else
{
Expand All @@ -218,10 +217,7 @@ private async Task HandlePovButton(JoystickOffset offset, int value)
_lastPovButton.TryAdd(offset, translatedOffset);
Logging.Log.Debug($"Pressing POV button: {offset} - {value}");

if (!(GetMap(translatedOffset) is HOTASButton map)) return;

await HandleButtonPressed(map, translatedOffset);
OnButtonPress(translatedOffset);
await HandleStandardButton(translatedOffset, (int)JoystickOffsetValues.ButtonState.ButtonPressed);
}
}

Expand All @@ -244,7 +240,7 @@ private async Task HandleStandardButton(int offset, int value)
_modeActivationButtons[_mode].InheritFromMode > 0)
{
map = GetMapFromParentMode(_modeActivationButtons[_mode].InheritFromMode, offset) as HOTASButton;
if (map != null)
;if (map != null)
{
await HandleButtonPressed(map, offset);
}
Expand Down

0 comments on commit 0682564

Please sign in to comment.