diff --git a/FlightStreamDeck.Core/TOGGLE_EVENT.cs b/FlightStreamDeck.Core/TOGGLE_EVENT.cs index 75b9e67..97b6343 100644 --- a/FlightStreamDeck.Core/TOGGLE_EVENT.cs +++ b/FlightStreamDeck.Core/TOGGLE_EVENT.cs @@ -804,6 +804,9 @@ public enum TOGGLE_EVENT MOBIFLIGHT_AS1000_PFD_CRS_INC, MOBIFLIGHT_AS1000_PFD_CRS_DEC, MOBIFLIGHT_AS1000_PFD_CRS_PUSH, + MOBIFLIGHT_AS1000_PFD_HEADING_INC, + MOBIFLIGHT_AS1000_PFD_HEADING_DEC, + MOBIFLIGHT_AS1000_PFD_HEADING_SYNC, MOBIFLIGHT_AS1000_PFD_SOFTKEYS_1, MOBIFLIGHT_AS1000_PFD_SOFTKEYS_2, MOBIFLIGHT_AS1000_PFD_SOFTKEYS_3, diff --git a/FlightStreamDeck.Logics/Actions/GenericToggleAction.cs b/FlightStreamDeck.Logics/Actions/GenericToggleAction.cs index ae26d4e..663ec95 100644 --- a/FlightStreamDeck.Logics/Actions/GenericToggleAction.cs +++ b/FlightStreamDeck.Logics/Actions/GenericToggleAction.cs @@ -353,7 +353,9 @@ protected override Task OnKeyDown(ActionEventArgs args) if (holdEvent.HasValue) { - timer = new Timer { Interval = settings.HoldValueRepeat ? 400 : 1000 }; + int frequency = GetRepeatFrequencyForMobiflightSettings(settings, 400); + timer = new Timer { Interval = settings.HoldValueRepeat ? frequency : 1000 }; + timer.Elapsed += Timer_Elapsed; timer.Start(); } @@ -361,6 +363,21 @@ protected override Task OnKeyDown(ActionEventArgs args) return Task.CompletedTask; } + private int GetRepeatFrequencyForMobiflightSettings(GenericToggleSettings settings, int defaultFreq) + { + int frequency = 0; + if (settings.HoldValue.StartsWith("MOBIFLIGHT_")) + { + int.TryParse(settings.HoldValueData, out frequency); + } + if (frequency == 0) + { + frequency = defaultFreq; + } + + return frequency; + } + protected override Task OnKeyUp(ActionEventArgs args) { if (settings.HoldValueSuppressToggle && !holdEventTriggerred)