The SimConnect_ClearInputGroup() is reported to be working, but I can't get it to work properly, nor I can find a way to stop intercepting events.
Attached here is the code I'm using, slightly modified from the InputEvent.cpp sample in the SDK.
In this case, I mapped the "a" key to a custom event. This WORKS, I press A in the sim, and the event happens.
However, as soon as I receive the event, I wanted to turn it off, but none of the following seems to work:
SimConnect_SetInputGroupState(hSimConnect, INPUT0, SIMCONNECT_STATE_OFF);
This one is the only one that doesn't result in an exception error. However, it doesn't do anything, the key is continuing to fire the event.
I tried all the following:
hr = SimConnect_ClearNotificationGroup(hSimConnect, GROUP0); hr = SimConnect_ClearInputGroup(hSimConnect, INPUT0); hr = SimConnect_RemoveClientEvent(hSimConnect, GROUP0, EVENT_1); hr = SimConnect_RemoveInputEvent(hSimConnect, INPUT0, "z");
All of them returns various unrecognized id exceptions, and the event continue to fire.
In addition to that, it seems that event notifications persist even after closing the Simconnect Client .EXE that requested them, meaning if I quit the application and start it again while the sim was continuing to run, the 2nd time the application runs, it gets 2 event notifications for each key, the 3rd time it gets 3 events notifications, the 4th time 4, and so on.
Could you please have a look at the attached code and see if I did something wrong, or there is in fact an issue with clearing or just disabling input or notification groups ?