Simconnect menu functions

Hello,

I'm busy with an application running on a client PC that captures the menu from an addon with the TextEventCreated and TextEventDestroyed system events. This is all working very well but is it possible to send a menu choice via simconnect back to the sim? It is working OK via Fsuipc with the SIMCONNECT_MENU_X controls. But I would rather do it via simconnect so I don't need Fsuipc for this. The only menu event I can find in the SDK documentation are the KEY_ATC_X events.

Rob
 
TextEventCreated and TextEventDestroyed? Whose system events are those?

I've created full multi-page menus in a SimmConnect client using SimmConnect functionality alone. They communicate with the sim flawlessly (that's what they were designed for). The only drawback is that they are limited to 10 items per menu (That's why I created multi-page menus), and they are single level (no cascading).
 
Hello Misho,

Thanks for your reply.

simConnection.OnRecvEventText += OnTextEvent;
simConnection.OnRecvEventTextDestroyed += OnTextEventDestroyed;

simConnection.SubscribeToSystemEvent(SimConnectEvents.TextCreated, "TextEventCreated");
simConnection.SubscribeToSystemEvent(SimConnectEvents.TextDestroyed, "TextEventDestroyed");

TextEventCreated is triggered when a SimConnect menu is shown in the simulator and in the event arguments all the menu items are passed.
So I can show that menu on a client. I didn't create the menu myself but in this case it is from GSX. Now I need to make a menu choice on the client and pass that back to the flightsim PC. Now I use FSUIPC for sending the menu item number I have choosen on the client PC to the server. But I would rather do that via SimConnect. But as far as I know there is no facility to send keys to the sim. How did you handle that situation?

Best,
Rob
 
Hi Rob,

What platform is this? P3D? if that's the case, I can't help... Also, I never used FSUIPC either, so I'm not much of a help there either.

However, I worked extensively with SimConnect menu system, and there is no "TextEventCreated" or "TextEventDestroyed" event to be subscribed to in FSX/FSX:A/FSX:SE SimConnect version.

First - let's clarify something:
  1. SimConnect_Menu*() functions create menu entries on the top bar, under "Add-ons" heading. So, you would have: Add-ons|My AddOn|(up to 16 entries)
  2. SimConnect_Text() function in SIMCONNECT_TEXT_TYPE_MENU mode is used to build a menu overlay panel, with heading, description and up to 10 choices, clickable with a mouse (much like the ATC communication menu in FSX)
So in essence, your app can have 16 entries and each entry can call up overlay menu with up to 10 choices, giving the app ability to control 160 parameters.

Which type (if any) are you trying to get going?
 
I'm using P3D. Let me explain what I'm doing. With GSX you can call the overlay menu (like the atc menu) with Shift+Ctrl+F12 on the sim PC. In P3D you can resize and/or move that menu. When you save a scenario the menu location/size will be saved also, so you can move it almost off screen. In my client application I use Fsuipc to send that key combination to P3D, so the menu will show. The TextEventCreated captures the menu items which are shown in the menu. So I can show them in my application. Now I can click one of the menu items and the selection needs to be send back to the sim. This is all working very well, the menu is now completely usable on a client PC. I was just wondering if I could use SimConnect to send that menu choice back to the sim. So it is working ok, just wondering if it could be done completely with SimConnect.

Best,
Rob
 
Ah ok - then this is something entirely different. You never mentioned GSX. Your question "is it possible to send a menu choice via SimConnect back to the sim" suggested you were asking something more fundamental.

Sorry, can't help you with that...
 
Since menu choices are by mouse/key input (it's a UI process not sim)... you would need to send the enter key for a menu selection.
 
Thanks for your response anyway Misho. But how do you make a menu choice via SimConnect then?

Rob
You make a menu choice by clicking on the choice with your mouse ;) (I'm obviously being cheeky because I still don't understand what you are asking). When you make a choice in the SimConnect menu, your DLL processes that choice to get it to do whatever you need.
You can set up the menu system using the methods I mentioned above, and then get menu to process the user's choice to make it do whatever you need. I am talking about the fundamental functionality of SimConnect, nothing to do with FSUIPC or GSX.

There are simple, clear cut, compilable samples in SimConnect SDK of how to do this:
  • For implementing top bar "Add-ons" menu entry, take a look at MenuItems sample.
    A more appropriate (MFC-style) term for this menu would be drop-down menu.

  • For implementing Dialog panel overlays (that can be invoked by "Add-ons" menu entries above) with up to 10 choices, take a look at TextMenu sample.
    A more appropriate (MFC-style) term for this menu would be dialog box menu.
 
Last edited:
Top