Connecting XML with C++ throught events

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Post Reply
gregorio.soria
Posts: 4
Joined: Thu Apr 15, 2021 10:10 am

Connecting XML with C++ throught events

Post by gregorio.soria »

Hello :)

I need to connect a C++ program with a custom event on a XML model.

I have added these lines to the model:

Code: Select all

<KeyMap id="trigger_map">
<Trigger id="Start">
<KeyEvent>EVENT_AP_ATK</KeyEvent>
<Script>
1 (>L:Switch1_Sound,number)
(L:AutoAttack, bool) ! (>L:AutoAttack, bool)
</Script>
</Trigger>
</KeyMap>
And on my program:

Code: Select all

#define KEY_EVENT_AP_ATK                          69633

void DefineEvents()
{
HRESULT hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EventsLHGSSignals::EVENT_ATK_ON, "#69633");
}

void ExecuteATKButtonInput()
{
SimConnect_TransmitClientEvent(hSimConnect, 0,atkModeSelected ? EVENT_ATK_OFF : EVENT_ATK_ON, atkModeSelected, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
}
But I can't receive the event on the XML.

Can you help me? Thanks.
gregorio.soria
Posts: 4
Joined: Thu Apr 15, 2021 10:10 am

Re: Connecting XML with C++ throught events

Post by gregorio.soria »

Solved
Post Reply