In the learning phase.
I am able to read events generated by SimConnect and process them.
But I am not able to raise an event with the change of a variable and send it to SimConnect.
I have read and reread documentation, but my clumsiness I am not able to see how it is done.
I am working with the Input Event example from the FSX SDK, to learn how to generate an event based on the value of a C ++ variable that reflects the state of the BREAK button.
I read the hardware status of my push button through the COM port, reflecting it in the variable Button_Sate (0/1).
My problem is: How to "modify" the example of "shift + ctrl + u" for my variable.
Obviously it is not to change the "shift + ctrl + u" by Button_Sate. After reading I understand that definitions are necessary, but I do not know which ones.
Use in void testInputEvents ():
SimConnect_TransmitClientEvent
SimConnect_SetDataOnSimObject using SIMCONNECT_OBJECT_ID_USER.
Can someone wise give light in this forest where I am?
Thanks.
EDIT POST:
In this other example: ThrottleControl.cpp
// Link the events to some keyboard keys
hr = SimConnect_MapInputEventToClientEvent (hSimConnect, INPUT_KEYS, "A", EVENT_A);
It is defined as INPUT_KEYS, "A",
In the SDK definition it says: "The SimConnect_MapInputEventToClientEvent function is used to connect input events (such as keystrokes, joystick or mouse movements) with the sending of appropriate event notifications."
How should I do to bind it to my Button_Sate variable. ??
Thanks.
I am able to read events generated by SimConnect and process them.
But I am not able to raise an event with the change of a variable and send it to SimConnect.
I have read and reread documentation, but my clumsiness I am not able to see how it is done.
I am working with the Input Event example from the FSX SDK, to learn how to generate an event based on the value of a C ++ variable that reflects the state of the BREAK button.
I read the hardware status of my push button through the COM port, reflecting it in the variable Button_Sate (0/1).
My problem is: How to "modify" the example of "shift + ctrl + u" for my variable.
Obviously it is not to change the "shift + ctrl + u" by Button_Sate. After reading I understand that definitions are necessary, but I do not know which ones.
Use in void testInputEvents ():
SimConnect_TransmitClientEvent
SimConnect_SetDataOnSimObject using SIMCONNECT_OBJECT_ID_USER.
Can someone wise give light in this forest where I am?
Thanks.
EDIT POST:
In this other example: ThrottleControl.cpp
// Link the events to some keyboard keys
hr = SimConnect_MapInputEventToClientEvent (hSimConnect, INPUT_KEYS, "A", EVENT_A);
It is defined as INPUT_KEYS, "A",
In the SDK definition it says: "The SimConnect_MapInputEventToClientEvent function is used to connect input events (such as keystrokes, joystick or mouse movements) with the sending of appropriate event notifications."
How should I do to bind it to my Button_Sate variable. ??
Thanks.
Last edited:
