How to you get the double (or string) value for an Input Event?
I am checking the parameter type (eType) and casting as appropriate, but I am always getting a value of 0.0:
case SIMCONNECT_RECV_ID_SUBSCRIBE_INPUT_EVENT:
{
char logMessage[128];
SIMCONNECT_RECV_SUBSCRIBE_INPUT_EVENT* evt = (SIMCONNECT_RECV_SUBSCRIBE_INPUT_EVENT*)pData;
..
if (evt->eType == SIMCONNECT_INPUT_EVENT_TYPE_DOUBLE)
{
sprintf(logMessage, "InputEvent received: '%s', Value=%lf (param='%s')", inputEvents[i].name, (double)evt->Value, inputEvents[i].parameter);
}
else if (evt->eType == SIMCONNECT_INPUT_EVENT_TYPE_STRING)
{
sprintf(logMessage, "InputEvent received: '%s', Value='%s' (param='%s')", inputEvents[i].name, (char*)evt->Value, inputEvents[i].parameter);
}
else
{
sprintf(logMessage, "InputEvent received: '%s' (param='%s')", inputEvents[i].name, inputEvents[i].parameter);
}
....
I have also tried as a float rather than a double, and the result is the same. Not sure if this value should be a float or a double (documentation is confusing on this), or how to read the actual value.
Also, when I enumerate the input event parameters, the parameter value of many input events is returned as an empty string (i.e. no parameters) with the SIMCONNECT_RECV_ID_ENUMERATE_INPUT_EVENT_PARAMS event, but many of these events do in fact take a parameter, and also a parameter is given when you subscribe to receive the Input Event. Why is this?