SimConnect_SetInputGroupState

The SimConnect_SetInputGroupState function is used to turn requests for input event information from the server on and off.

 

Syntax
HRESULT SimConnect_SetInputGroupState(
      HANDLE  hSimConnect,
      SIMCONNECT_INPUT_GROUP_ID  GroupID,
      DWORD  dwState
      );

 

Parameters
Parameter Description Type
hSimConnect Handle to a SimConnect object. Integer
GroupID Specifies the ID of the client defined input group that is to have its state changed. Integer
dwState Double word containing the new state. One member of the SIMCONNECT_STATE enumeration type. Integer

 

Return Values

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

Return value Description
S_OK The function succeeded.
E_FAIL The function failed.

 

Example
static enum INPUT_ID {
    INPUT_1,
    INPUT_2
    };
static enum EVENT_ID {
    EVENT_1,
    EVENT_2
    };
      ....
hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_1, "parking_brakes");
hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_1, "ctrl+U+Q", EVENT_1);
hr = SimConnect_SetInputGroupState(hSimConnect, INPUT_1, SIMCONNECT_STATE_ON);

 

Remarks

The default state for input groups is to be inactive, so make sure to call this function each time an input group is to become active.

 

See Also