MobiFlight / MobiFlight-Connector

MobiFlight is an open source project that allows you to create your own home cockpit for your favorite flight simulator in a flexible, affordable and extremely user-friendly way.
https://mobiflight.com
MIT License
235 stars 104 forks source link

Exclude "long-push" inputs from "Retrigger Action with Run" #1856

Open circuitavionics opened 2 hours ago

circuitavionics commented 2 hours ago

Perhaps a clearer explanation is on my original Discord post. Was asked to report it here as a bug.

Describe the bug The option "Automatically perform retrigger action" can not be used where inputs are defined with both a long-push and short-push option.

Steps To Reproduce Set up a button to do a short-push and long-push as follows: On Press - nothing (otherwise it will execute every time) On Release - put the short-push command here On Hold - put the long-push command here with the time delay On Long Release - put a dummy command e.g. a 0 here - required to make the button into a "long-push" button

Enable the option "Automatically perform retrigger-action with "run"-mode" Run the profile.

Expected behavior Because an "On Long Release" is set, MobiFlight should not send the "On Release" defined in the config.

Actual behavior The button is detected as released, so the "On Release" command is sent.

Details

Additional context My own suggestion on the Discord post was to resolve this by having a checkbox on the config's input page "Exclude from Retrigger-action on Run" Tuomas had maybe the better suggestion - that it could be automatically excluded from the retrigger if a long-push ("On Long Release") is defined in the input config

tigert commented 1 hour ago

Also, the point of retrigger functionality is to sync the current physical switch state with the simulated aircraft, in case some toggle switches are left ON and the plane loads with them off, for example. This really happens only with toggle or latching switches.

So "long press" does not exist in that context - long press happens mostly on pushbuttons that never stay pressed on their own.