EVENT API
The Microsoft Flight Simulator 2024 Event API permits you to trigger different kinds of key events. This API replaces some features provided by the deprecated Gauge API.
The functions available for this API are as follows:
Function | Description |
---|---|
fsEventsTriggerKeyEvent |
Trigger a Key Event. |
fsEventsRegisterKeyEventHandler |
Register a Key Event handler which will receive all Key Events raised by the simulation. |
fsEventsUnregisterKeyEventHandler |
Unregister a Key Event handler that has been previously registered. |
You can find a sample project to use as a reference when using the Event API here:
- COMING SOON!
Typedefs
When using this API the following typedefs exist to help:
-
typedef int FsEventId;
FsEventId
: the ID of an Event. The list of all available Ids can be found inMSFS/Types/MSFS_EventsEnum.h
.
-
typedef void(*FsEventsKeyEventHandler)(FsEventId eventId, FsVarParamArray* param, void* userParam);
FsEventsKeyEventHandler
: Callback signature for the key event handlereventId
: Id of the received event.param
: values received with the event. Value can beindex
orFsCRC
. To manage this type, helper functions can be found inMSFS/Utils/SimParamArrayHelper.h
.userParam
: pointer data that will be given to the user who has register the handler