SimConnect Events Issue

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
Post Reply
Poloche
Posts: 7
Joined: Mon Mar 10, 2014 6:18 pm

SimConnect Events Issue

Post 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.
obinder
Posts: 145
Joined: Sun Jun 08, 2014 9:43 am

Re: SimConnect Events Issue

Post 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
EllipticCurve
Posts: 151
Joined: Mon Jun 12, 2017 6:14 pm

Re: SimConnect Events Issue

Post 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;
}
}
All comments and opinions are my own.
Post Reply