• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Event IDs-Which Ones Work???

Messages
4
Country
unitedstates
I am using SimConnect in my application to read data from FSX; pitch, bank, etc. This all works fine. Now I want to use the Event IDs to trigger FSX. I am having success with some IDs but others do nothing?? Is anyone aware of this unreliability. Specifically I am trying to trigger the Garmin G1000 PFD while flying the Cessna C172SP Skyhawk G1000. I can get G1000_PFD_ZOOMIN_BUTTON and G1000_PFD_ZOOMOUT_BUTTON to work but nothing else in that G1000 Keys group? I am able to get several other Event IDs to work (COM_STBY_RADIO_SWAP,COM_RADIO_WHOLE_DEC, COM_RADIO_WHOLE_INC, COM_RADIO_FRACT_DEC, COM_RADIO_FRACT_INC,HEADING_BUG_DEC,HEADING_BUG_INC, ....) but some I really need don't (TOGGLE_DME, FREQUENCY_SWAP). When I click on the G1000 in the game (even while Paused) the FPL button displays the Flight Plan page so why doesn't G1000_PFD_FLIGHTPLAN_BUTTON event do the same thing? Am I wasting my time trying to get this to work? My code is fine, I assume, since many of the events do work as expected. Any insight would be greatly appreciated. Thanks.
 
Hi Jonsie!

How are you trying to trigger these events? is it keypresses or based on other events, or a button in the form window?

I haven't had many problems with events myself, but haven't tried those quoted.

Are you willing to post your code so I can try it on my machine? not suggesting that you are doing anything wrong, its just I'm sure you know, sometimes things work on one machine but not another and vice versa!

Thanks,

Alex
 
Hi Alex,

I am triggering the events from a button in the form window. Below is a very simplified version of my code. On the form Button6 calls my function with an integer which is actually the EventId in this case. In PISimConn_SendEvent I call SimConnect_MapClientEventToSimEvent using several EventIds then I transmit. I use eventData=0 all the time. So in this sample code the first 4 EventIds work (zoom and heading bug) but the procedure and flightplan don't. I am wondering if I need to use something other than SIMCONNECT_OBJECT_ID_USER or if the priority flags are correct.

Thanks a ton for the help! I really appreciate it.

Jonesie

void __fastcall TForm1::Button6Click(TObject *Sender)
{
int eventdata=4;
int res=PISimConn_SendEvent("temporarily not used", eventdata);
}

extern int PISimConn_SendEvent(const char *eventName, int eventData)
{

string name(eventName);
long eventId;


eventId=eventData;
eventData=0;
//map the eventIDs I want

SimConnect_MapClientEventToSimEvent(hSimConnect, 1, "g1000_pfd_zoomin_button");
SimConnect_MapClientEventToSimEvent(hSimConnect, 2, "g1000_pfd_zoomout_button");
SimConnect_MapClientEventToSimEvent(hSimConnect, 3, "heading_bug_dec");
SimConnect_MapClientEventToSimEvent(hSimConnect, 4, "heading_bug_inc");
SimConnect_MapClientEventToSimEvent(hSimConnect, 5, "g1000_pfd_procedure_button"); //doesn't work
SimConnect_MapClientEventToSimEvent(hSimConnect, 6, "g1000_pfd_flightplan_button"); //doesn't work



if (S_OK == SimConnect_TransmitClientEvent(hSimConnect, SIMCONNECT_OBJECT_ID_USER, eventId, eventData,
SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY))
{
return TRUE;
}
return FALSE;
}
 
Back
Top