Hey, thanks! The problem is, there ARE no SDK samples for this particular case, unless I am missing something...
Ok, I implemented my code, but no dice
Here is the code, first, setup on SimConnect/C++ side:
Code:
hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_CUSTOM_K_VAR, "CUSTOM_K_VAR");
hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_KEYS, EVENT_CUSTOM_K_VAR);
hr = SimConnect_SetNotificationGroupPriority(hSimConnect, GROUP_KEYS, SIMCONNECT_GROUP_PRIORITY_HIGHEST);
And then, in JS, where the event is triggered:
Code:
onToggle_MY_TOGGLE() {
if (this.m_toggle_MY_TOGGLE.toggled) {
SimVar.SetSimVarValue("K:CUSTOM_K_VAR", "number", 0);
}
}
And finally, in the event loop, where the event should be trapped:
Code:
case SIMCONNECT_RECV_ID_EVENT:
{
SIMCONNECT_RECV_EVENT *evt = (SIMCONNECT_RECV_EVENT*)pData;
switch(evt->uEventID)
{
case EVENT_CUSTOM_K_VAR:
printf("EVENT_CUSTOM_K_VAR WORKING\n");
break;
No event is being trapped