View Full Version : Event IDs-Which Ones Work???
03 Oct 2007, 11:08
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_IN C, ....) 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.
05 Oct 2007, 17:42
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!
09 Oct 2007, 10:04
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.
void __fastcall TForm1::Button6Click(TObject *Sender)
int res=PISimConn_SendEvent("temporarily not used", eventdata);
extern int PISimConn_SendEvent(const char *eventName, int eventData)
//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,
vBulletin® v3.8.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.