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>
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);
}
Can you help me? Thanks.