The SimConnect_SetInputEvent function is used to set the value of a specific input event (identified by its hash). See SimConnect_EnumerateInputEventParams for an example of use.

 

Syntax
HRESULT SimConnect_SetInputEvent(
    HANDLE hSimConnect,
    DWORD Hash,
    DWORD cbUnitSize,
    PVOID Value
)

 

Parameters
ParameterDescriptionType
hSimConnectHandle to a SimConnect object.Integer
HashHash ID that will identify the desired inputEvent.Integer
cbUnitSizeSpecifies the size of the value in bytes.Integer
ValueNew value of the specified inputEvent.Float/String

 

Return Values

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return valueDescription
S_OKThe function succeeded.
E_FAILThe function failed.

 

This function might throw one of the following SIMCONNECT_EXCEPTION:

  • SIMCONNECT_EXCEPTION_ERROR in case of internal errors.
  • isSIMCONNECT_EXCEPTION_SET_INPUT_EVENT_FAILED if the given hash in wrong.

 

Remarks

This function will set the value of an input event and generates no response event. You can get the hashes for the available input events using SimConnect_EnumerateInputEvents.