Jump to content
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

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;
}
}

Roar Kristensen    www.flightsim4fun.com

P3Dv4 with Opencockpits hardware controlled by OC4BAv4 for immersive PMDG B737/777/747 flying

XPLANE 11 with Opencockpits hardware controlled by OC4BA_XP for immersive  B737 flying

rmMShli.jpg?1 WylQl0J.jpg?3

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...