Djeez1

How to operate MFD buttons through SDK ?

Recommended Posts

When using the SDK to control the 737NGX I experience strange behavior when controlling the MFD buttons such as

EVT_MPM_MFD_ENG_BUTTON and EVT_MPM_MFD_SYS_BUTTON.

When I send a control with parameter 1 the button gets pressed and the MFD changes, but when I send a parameter -1, the button is released but the function is activated again, resulting in another change in MFD. How should I properly release the button press without activating the function again?

Thanks!

Emile van Gerwen.

(737NGX on P3D v2.5)

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Posted (edited)

Emile, it depends of the function.  For example, pitch control cannot generally be turned on or off rather it changes from one mode to another.  This is on the MCP and of course I reread and saw MFD......, I suspect the button has only a press value since they are spring loaded and do not stay in when pressed.

Edited by downscc

Share this post


Link to post
Share on other sites

Thanks for your response. In this case, you can see in the Virtual Cockpit that the button is pressed and keeps being down if I send it the "1" parameter. Furthermore, it is not possible to "press" it again by sending it another "1" so it looks like I really need it to "release" again. This does happen when I send it a "-1", but, and that is my problem, that triggers the function again.

Regards,

 

Emile van Gerwen,

Share this post


Link to post
Share on other sites

That is interesting, because they operate on a mouse click as a momentary spring return button.  May I suggest that you document the discrepancy in a trouble ticket, not sure it will lead to anything quickly but it might be of value in the development of NG3.

Share this post


Link to post
Share on other sites

For others having the same issue:

I found a solution to not set a value directly but to emulate a mouse click:

MOUSE_FLAG_LEFTSINGLE = 0x20000000  # mouse click from PMDG SDK
ipc.control(70095, MOUSE_FLAG_LEFTSINGLE)

This is not showing the on-screen button pressed and released the same as the physical button but clicking the physical button presses and releases the on-screen button, just as it would at mouse click.

Emile van Gerwen.

Share this post


Link to post
Share on other sites

When setting controls directly, buttons and 2-position switches are boolean (0 and 1).  In C++ 0 is 'false' and I think any other value that can be implicitly converted to a bool is 'true'.  Examples from my NG in FSUIPC:

1=P1,6,C70316,1 ; EVT_CONTROL_STAND_TOGA1_SWITCH         1=Depress     -{Custom control: <70316>}-
2=P1,3,C70319,1 ; EVT_CONTROL_STAND_TOGA2_SWITCH         1=Depress     -{Custom control: <70319>}-
3=U1,6,C70316,0 ; EVT_CONTROL_STAND_TOGA1_SWITCH         0=Release     -{Custom control: <70316>}-
4=U1,3,C70319,0 ; EVT_CONTROL_STAND_TOGA2_SWITCH         0=Release     -{Custom control: <70319>}-
5=P1,5,C70314,1 ; EVT_CONTROL_STAND_AT1_DISENGAGE_SWITCH 1=Depress     -{Custom control: <70314>}-
6=U1,5,C70314,0 ; EVT_CONTROL_STAND_AT1_DISENGAGE_SWITCH 0=Release     -{Custom control: <70314>}-
7=P1,2,C70317,1 ; EVT_CONTROL_STAND_AT2_DISENGAGE_SWITCH 1=Depress     -{Custom control: <70317>}-
8=U1,2,C70317,0 ; EVT_CONTROL_STAND_AT2_DISENGAGE_SWITCH 0=Release     -{Custom control: <70317>}-

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now