Workaround for hold‐events like engine starter key using VJoy - MobiFlight/MobiFlight-Connector GitHub Wiki

MobiFlight uses the x-plane UDP network interface to interface directly with various versions of X-Plane (at least 11 and 12 are tested)

The interface works otherwise fine, but does not support "holding" an event, but it is just sent immediately. This is a problem for events like the engine starter key, where you would need to keep the key in the start position until the engine starts, but x-plane just sets the key to "start" position and immediately after returns it.

To make this work we need to set the key to "start" on the OnPress event in MobiFlight, and release it on OnRelease. In practice, it should be set to "both" position in most general aviation magneto switches.

We can achieve this via XPUIPC or FlyWithLua plugins for x-plane - essentially splitting the event in two parts and doing it in OnPress and OnRelease events in two parts.

We can also achieve this using VJoy virtual joystick events, because in X-Plane you can well bind a joystick button to "engine starter on" and "engine starter off".

First install VJoy following the instructions in the package. You likely need to reboot afterwards to make it work.

https://sourceforge.net/projects/vjoystick/

Then set the Action Type to "Virtual joystick input (vJoy)" and set it to send a button ON event on OnPress and button OFF event on OnRelease in MobiFlight. The button number can be 1 or whatever you like, as long as you dont use it for something else.

image

Afterwards you can test this in VJoy Monitor tool: image

At this point the switch works like any joystick button in Windows, so you can bind it to the starter key in x-plane.