Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Afds and gear lever problems SDK C++

Featured Replies

Hi everyone,

 

Working on interfacing my phidget and pokeys cards to work with NGX. MIP is soon finished but I have some problems with the afds annunciators and gear lever.

 

My problem with afds annunciators is that I cannot determine if the annunciator is red or yellow. No matter how I look in the array it reports the same for both red and yellow. How can I get info from the SDK if the annunciators is red or yellow?

 

And my problem with the gear lever is that nothing happens with the gear lever event. No problem at all with the other switches but gear lever just won't work.

 

If anyone can point me in the right direction I would be very happy!

 

Thanks a lot guys!

Regards,

Anders

I don't know about the afds but I also struggled with the gear lever. In the SDK it's not always easy to understand how to control things, like what parameters to set and what they will do, or if the control event should be regarded as a lever etc. I tried pretty much all combinations of setting EVT_GEAR_LEVER, EVT_GEAR_LEVER_OFF, EVT_GEAR_LEVER_UNLOCK with various results. I finally settled with emulated mouse clicks. I'm sure there must be a prettier way to do it but it seems to work.

 

Gear UP:

SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_GEAR_LEVER, MOUSE_FLAG_RIGHTSINGLE,SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);

 

Gear OFF (when currently set to UP):

SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_GEAR_OFF, MOUSE_FLAG_LEFTSINGLE,SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);

 

Gear DOWN (regardless if the lever is in UP or OFF position):

SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_GEAR_LEVER, MOUSE_FLAG_LEFTSINGLE,SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);

Sleep(300);

SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_GEAR_LEVER, MOUSE_FLAG_LEFTSINGLE,SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);

 

 

EVENT_GEAR_LEVER is mapped to EVT_GEAR_LEVER and EVENT_GEAR_OFF is mapped to EVT_GEAR_LEVER_OFF via SimConnect_MapClientEventToSimEvent.

  • Author

Thank you very much for the tip! Will try that until PMDG will fix the lever..must be something wrong in the SDK.

 

Regards,

Anders

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.