Not really. Events can be either strings or numeric IDs. A simulator default event is usually a name (even if it has an ID as well ), but you can create custom event using a string:
SimConnect_MapClientEventToSimEvent( hSimconnect, EVENT_ID, âMy.Event.Nameâ )
The EVENT_ID on the 2nd parameter itâs only relevant to the client, it can be 0, 1, 2, 3, etc ( they are usually like this, because are listed inside an Enum that starts from 0 ), what matters to the sim is the 3rd one, which is a string in this case.
Quoting from the SDK:
If the event name includes one or more periods (such as âCustom.Eventâ in the example below) then they are custom events specified by the client, and will only be recognized by another client (and not Microsoft Flight Simulator) that has been coded to receive such events.
So, in our version of the reinvented wheel, which we had to reinvent like everybody is doing too, because thereâs no way to access L: and H: vars or fire up executeCalculator code from SImconnect, we did something like this, in this case the âRegister Variableâ command:
SimConnect_MapClientEventToSimEvent(g_hSimConnect, EVENT_WASM_API_REGISTER_VARIABLE_QUERY, "WASM.RegisterVariableQuery");
SimConnect_MapClientEventToSimEvent(g_hSimConnect, EVENT_WASM_API_REGISTER_VARIABLE_RESPONSE, "WASM.RegisterVariableResponse");
These are used BOTH in the Server ( WASM module ) and the Client ( regular EXE ), just they use their client data areas reversed, what is âInputâ for one is âOutputâ for the other.
Now, suppose the .EXE client wants to Register a new L: variable, it will use SimConnect_TransmitClientEvent, with the EVENT_WASM_API_REGISTER_VARIABLE_QUERY, which will send to the sim the âWASM.RegisterVariableQueryâ custom event.
The server is waiting its own EVENT_WASM_API_REGISTER_VARIABLE_QUERY id, but what is really waiting for is the âWASM.RegisterVariableQueryâ event from the Simconnect pipe, the id can be anything, it only matters to the client.
When the server receives the event, it will do the actual register_named_variable() call ( it can, because itâs a WASM module ), and will do a SimConnect_TransmitClientEvent with EVENT_WASM_API_REGISTER_VARIABLE_RESPONSE which, again, can be anything, what really matters is that is in fact transmitting the âWASM.RegisterVariableResponseâ custom event name.
The client is waiting its own EVENT_WASM_API_REGISTER_VARIABLE_RESPONSE, but what is really waiting for is the âWASM.RegisterVariableResponseâ, and when it gets it, it will read from the shared client area what has been setup the id of the L: variable which has been associated to the newly registered L: var ( or an existing id, if it was already defined )
This id will be used in the future by the Client, to Write or Read data, using a similar communication methods named âWASM.GetVariableQueryâ and âWASM.GetVariableQueryâ to READ an L: variable, or âWASM.SetVariableQueryâ and âWASM.SetVariableResponseâ to WRITE an L:Variable.
So no, itâs entirely possible to create custom events with low risk of name clashing, as long the event names are unique, itâs a method we have been using for quite some time, the SODE â GSX communication API works like this, for example, and so does our new WASM module that will be used by GSX for MSFS to do all sort of things related to using L: or H: variables or calling execute_calculator_code when needed.