Simconnect Events fired multiple times for single switch action

Hello, we noticed there is a potential issue with some events which keep
firing when their boolean value is set to 1 - for example: PARKING_BRAKE_SET
This event is fired when the TCA Thrustmaster Engine Quadrant Parking Brake
switch is set to 0 or 1. When the switch is set to OFF, the event comes back
only once (as expected). When the switch is set to ON, the event keeps firing
(with dwData set to 1 always). Same issue with STARTER_SET events (which the
TCA Engine Quadrant has assigned to the master engine switches, along with SET
ENGINE MASTER events). Is this by design? If yes, how do we avoid it or
circumvent it so that only a single event is fired in either case? Thanks!

How frequently are you getting the sim data back? Per frame?

Here’s some debugging output - does it answer your question?

(tick: 1682765783.389) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765783.429) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765783.482) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765783.528) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765783.584) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765783.635) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765783.686) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765783.741) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765783.802) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765783.853) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765783.911) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765783.964) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1682765784.004) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1

Hello, just bumping this up so it doesn’t get lost… thanks!

Hello guys- @Boris @EPellissier would you care to comment on the above? Is
there something you might need from us to let you reproduce the behavior, or
is it by design? Thank you!

Hi @simfan, This is actually by design. While some devices send an event
when a button is pressed, and another one when the button is released,
others prefer to send an event while a button is pressed (they never tell
you explicitely that it has been released). Because of this, some of our key
events are sent to you with a fake “0” value when we stop receiving the
continuous “pressed” message from the device. However we decided to forward
all “pressed” messages - which I understand can cause confusion. There is no
workaround to stop receiving this “pressed” messages but they can be safely
ignored. Best regards, Eric / Asobo

Hi @EPellissier thank you for your reply! Is there any way we can find out
which events are ones containing this logic so we can ignore them in the code?
A list somewhere? Kind regards,

Hello @EPellissier - thank you for your previous reply- I am coming back to
this topic as it seems that the list of events that exhibit this behavior
includes several that are mapped by default to the TCA Engine Quadrant
hardware (for example), namely:

ENGINE_MODE_CRANK_SET
ENGINE_MODE_IGN_START_SET
STARTER1_SET
SET_STARTER1_HELD
STARTER2_SET
SET_STARTER2_HELD
AUTOBRAKE_DISARM
AUTOBRAKE_LO_SET
AUTOBRAKE_MED_SET
AUTOBRAKE_HI_SET
GEAR_UP

and others I might not have listed above. Just to give you an idea, this is a
list of events that fired during a normal, still on-ground, start up routine
of an aircraft, just after engines have been started. You will notice that
there are 112 events firing within the period of just a single second.
While you are correct that we can safely ignore the repeating of these events
in our code handler, we noticed that there is performance degradation only
because the code has to go through the hoops of alerting pertinent areas that
the events even fired. (This is after optimizing the event handlers
themselves, even). Would you happen to be able to reconsider having those
events firing repeatedly, perhaps with an option set in a configuration
setting? For your information, here’s a list of 112 events unnecessarily fired
within a period of just a single second, as logged by our internal logger:

(tick: 1684329072.027) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.027) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.027) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.027) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.062) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.062) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.062) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.062) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.106) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.107) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.107) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.108) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.147) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.148) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.148) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.148) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.183) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.184) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.184) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.184) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.217) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.217) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.218) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.218) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.251) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.252) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.252) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.252) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.283) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.283) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.283) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.284) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.313) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.313) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.313) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.314) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.345) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.346) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.346) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.346) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.377) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.378) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.378) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.378) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.407) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.408) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.408) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.408) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.437) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.437) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.437) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.438) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.471) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.471) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.472) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.473) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.504) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.504) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.504) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.505) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.533) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.534) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.534) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.535) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.564) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.564) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.564) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.565) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.599) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.600) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.600) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.600) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.629) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.630) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.630) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.630) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.665) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.665) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.666) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.666) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.697) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.698) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.698) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.698) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.731) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.732) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.732) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.732) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.765) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.766) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.767) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.768) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.802) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.802) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.802) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.802) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.836) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.837) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.837) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.837) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.871) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.871) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.872) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.872) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.903) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.904) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.904) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.904) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.940) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.941) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.941) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.941) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1
(tick: 1684329072.976) - received Event: ENGINE_MODE_CRANK_SET ((null)) - dwData = 0
(tick: 1684329072.976) - received Event: SET_STARTER2_HELD ((null)) - dwData = 1
(tick: 1684329072.977) - received Event: SET_STARTER1_HELD ((null)) - dwData = 1
(tick: 1684329072.977) - received Event: PARKING_BRAKE_SET ((null)) - dwData = 1