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
anthonym
Posts: 13
Greetings. I hope the Christmas and New Year is treating you all well.

I have made a separate panel I can use for General Aviation aircraft, (a2a aircraft etc). The T6 Texan in particular has a different style of autopilot that uses two buttons (Left and Right, to change the heading. I have the lvars for the buttons. I have not designed the new panel to have these two buttons but was planning to use the encoders I already have for use with the PMDG 737 etc that uses rotary knobs to change the heading.

As the encoder sends 'pulses', I am finding it impossible to toggle the lvar so each pulse of the encoder sends a single button push cycle. (push and release). Currently it will push the button but not release. It will release but not until the next pulse. ie two pulses needed to push and release instead of one pulse to push and release. I hope the description is clear.

Lvar for left button is L:ApLeftArrowButton=TOGGLE

I have tried to transform value with if(@=1,1,0) and various combinations. if($=1,0,1) ...etc. Does this formula require more info or totally wrong?
I have tried L:ApLeftArrowButton=SET but has the same results. MF will push button but not release.
I have tried FSUIP Mouse Macro with Key command of Ctrl + D4 with no action at all. (Can MF handle combinations of keys or only single keys as I have had that problem before. MF would only work with single keys)

Is using encoders to push buttons even possible as I am wanting it to do? If there is a way to achieve this some advice would be greatly appreciated.

Regards
AnthonyM
2021-12-30 04:25
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

A2A (and some other addons) are a bit tricky.....
In case they work with all this LUA Script stuff!

Basically your right.... A Button in MF can have a Press and a Release Command. A Encoder only have On Left and On right ( Also FAST, but thats no factor here).
Means a detent on one direction only send ONE command..... Instead to a button, that can send 2 commands by a momentary usage ( press AND release).

Solution:

I would think about rework your "Lua Script" .
For sure you can say there something like "If Command received, then simply execute TWO TIMES the command "toggle switch".
Means if you would use a button you also only use the On Press to send ONE signal ( Instead of 2 times the same also on release).
Then Button and encoder would do the same ( from point of view by Mobiflight).

If it is not possible to rework your script..... then maybe a Duplicate of the Input Config is the key.....
If you create 2 Configs for the Encoder.... Both with same settings..... then each detent occure in a sending of 2 signals directly behind.

OR

As you expect.... If it is possible to set the needed function ( e.g. HDG INC and DEC) to a KEy command..... then you can simply export this Key with Mobiflight .
E.g. the Encoder can say... On LEft send ALT-F On Right send CTRL-Y
You can use the ModKey by simply press e.g. SHIFT-X same time while you click the Key select Option in MF.
Good Luck !
2021-12-30 17:19
icon