MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
simtcr
Posts: 12
Hello,

I am trying to setup a custom switch panel with two DPDT Rocker Momentary Switches. (https://robu.in/product/dpdt-rocker-switch/)
One placed horizontally and other placed vertically.

Action on Left click of horizontally placed switch is AS1000_MFD_JOYSTICK_LEFT
Action on Right click of horizontally placed switch is AS1000_MFD_JOYSTICK_RIGHT
Action on Up click of vertically placed switch is AS1000_MFD_JOYSTICK_UP
Action on DOWN click of vertically placed switch is AS1000_MFD_JOYSTICK_DOWN

It works. But the problem is,
I have to keep pressing and releasing (so many times) to move the map LEFT/RIGHT/UP/DOWN.
I was hoping if there is a way I can set this up in such a way that, as Long as I press and hold the button the set action continue running. For eg, if I press and hold left button, I want map to be moved left continuously.

Is that doable?

Thank you
2021-11-13 12:50
Avatar
simtcr
Posts: 12
Thank you Jaime for helping.
Here is an article written by him, https://github.com/MobiFlight/MobiFlight-Connector/wiki/MSFS2020-RPN-Tips-and-Tricks#8-simulating-short-and-long-button-presses

For my specific use case, below resolved the issue.

Short Long Press - Input with Custom input on press,
1 (>L:myBtn,bool) (E:SIMULATION TIME,second) 0.25 + d (>L:myTshort) (>L:myTlong)

Short Long Press - input with Custom input on release,
(E:SIMULATION TIME,second) (L:myTshort) < if{ (>H:AS1000_MFD_JOYSTICK_UP) }
0 (>L:myBtn) 0 (>L:myTshort) 0 (>L:myTlong)

Long Press - Output - Sim Connect Variable and Variable value as,
(L:myBtn) (E:SIMULATION TIME,second) (L:myTlong) > and if{ (L:myTlong) 0.05 + (>L:myTlong) (>H:AS1000_MFD_JOYSTICK_UP) }
2021-11-16 07:26
icon