Hi John,
Not an urgent problem but just a suggestion for future versions of FSUIPC, which could save a lot of LUA programming if you want to make multiple use of a single button.
Very often many users with a limited number of buttons make use of the method, to distinguish between a shot button press and a long one to trigger different functions. There is a nice example in the documentation folder (TripleUse.lua), how to solve this by a LUA program. But you have to code this for all button events, which you monitor, where you need this functionality.
The current syntax of the event.button trigger (or at least one of the four possible) looks like this:
event.button(joynum, button, downup, "function-name")
Addimg one additional parameter (duration in msec to identify a long press) in case of downup being 2 (detecting the up event) could return a different downup for a short and for a long button press.
event.button(joynum, button, downup, "function-name",longpress)
event.button(j17, 3, 2, "myFunction",2000) for example would return downup as usual when the button was pressed shortly. Pressing it longer that 2 seconds could return a different downup value to the defined function, which then could do different things depending on the returned value.
This could be made completely upward compatible. If there is no parameter specified, it returns downup as usual. In fact this would only affect events, where downup is specified as 2 (or 3). All the other behavior stays completely the same. So if the code for remembering the point in time, when the button went down and deciding according to the duration when the button went up again in case if there is a longpress parameter supplied, could move to FSUIPC, this would save a lot of LUA coding on pilot side. And all the existing LUA programs would work as before.
So if you once should have plenty of time on a rainy day, maybe you think about the proposal 😉
Best regards and thanks for the great addon.
Reinhard