Page 1 of 1

SimConnect Events Issue

Posted: Tue Dec 11, 2018 2:59 am
by Poloche
Hello,

I am trying to associate P3D events with timestamps in a excel sheet. However, it seems that some flags do not change:

For example, I am using the PAUSE_TOGGLE event and the PARKING_BRAKES event, but when I keep pausing and unpausing, or turning on and off the parking brakes, I always get the 0 value:

https://imgur.com/a/Evg6UWO

I am pretty sure that it happens with other events too. Is there a way to go around this issue?

Thanks for your help,

Sebastien.

Re: SimConnect Events Issue

Posted: Tue Dec 11, 2018 6:25 am
by obinder
Hi,

generally speaking, events don't return a value. They are "things happening", representations of key presses, not variables.

PARKING BRAKE is just a toggle event. No matter what value you send with the event, it will always just toggle the parking brake to the other state. To get the actual value (=if the parking brake is set or not), you must query the simulator variable BRAKE PARKING POSITION. Oh, and the aircraft that you are using the event on must acutally have a parking brake.

PAUSE is a system event. You query the current state with SimConnect_SubscribeToSystemEvent.


Best regards
Oliver Binder
Lorby-SI

Re: SimConnect Events Issue

Posted: Sun Apr 28, 2019 10:29 pm
by EllipticCurve
See the following code snippet:

case SIMCONNECT_RECV_ID_OPEN:
{
hr = SimConnect_SubscribeToSystemEvent(hSc,EVENT_SIM_START,"SimStart");
hr = SimConnect_SubscribeToSystemEvent(hSc,EVENT_SIM_STOP,"SimStop");
hr = SimConnect_SubscribeToSystemEvent(hSc,EVENT_SIM_PAUSE,"Pause");
}

......

case SIMCONNECT_RECV_ID_EVENT:
{
SIMCONNECT_RECV_EVENT *evt = (SIMCONNECT_RECV_EVENT*)pData;

switch(evt->uEventID)
{
case EVENT_SIM_START:
{
}
break;
...
case EVENT_SIM_STOP:
{
}
break;
...
case EVENT_SIM_PAUSE:
switch(evt->dwData)
{
case PAUSED:
{
}
break;
case UNPAUSED:
{
}
break;
}
break;
}
}