Sign in to follow this  
Lucas777

NGX SDK, can't set the gear down

Recommended Posts

Hey guys, I'm currently working on my B738 home made cockpit based on the PMDG 737 NGX

I already have a lot of controls working, but i'm currently stuck with the gear.

It's frustrating due the lack of documentation but playing a bit with values I managed to make the gear move to the UP position
 

SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_GEAR_LEVER,-1, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);

and
 

hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_GEAR_LEVER, "#70087");    

That worked, however I'm unable to make the gear to go down, tried almost any value and it only seems to work with -1 and it makes it to go up.

In the PMDG_NGX_SDK.h file the MAIN_GearLever variable is commented as

// 0: UP  1: OFF  2: DOWN

So I tried to directly change its value, didn't work either, I guess it is read-only.

 

Any idea how can achieve this?

 

Thanks in advance.

Share this post


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

Never found a fix so I just hardcoded this by simulating a "G" keystroke, which switch the gear up/down

Share this post


Link to post
Share on other sites

Hi,

here is my lines for Gear handling

 

 

2447 GEAR_LEVER
2448 GEAR_LEVER_OFF
2449 GEAR_LEVER_UNLOCK
 

 

if (var == 2447)
{
if (val == 1)
{
SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_GEAR_LEVER, MOUSE_FLAG_RIGHTSINGLE, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
return match;
}
 
}
 
if (var == 2448)
{
if (val == 1)
{
SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_GEAR_LEVER, MOUSE_FLAG_LEFTSINGLE, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
return match;
}
}
 
if (var == 2449)
{
if (val == 1)
{
 
SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_GEAR_LEVER, MOUSE_FLAG_LEFTSINGLE, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
return match;
}
}

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
Sign in to follow this