- Messages
- 65
- Country

Hi folks,
I'm writing a simconnect client and want to turn on and off certain joystick and keyboard inputs. Specifically, I'm masking the Joystick input and using it to control a tug instead of the aircraft, but of course, I only want to mask it while in "tug mode". It works great, but after maybe 5 cycles or so it stops working, and I'm unable to mask to get the joystick info. Is there a built-in limit to how many times you can request and unrequest or mask and unmask, or am I not using the right functions?
This is how I'm turning it on:
SimConnect_MapClientEventToSimEvent(hSimConnect, temp.id);
SimConnect_AddClientEventToNotificationGroup(hSimConnect, temp.id, temp.id, true);
SimConnect_MapInputEventToClientEvent(hSimConnect, temp.id, name, temp.id, 0, SIMCONNECT_UNUSED, SIMCONNECT_UNUSED, true);
SimConnect_SetInputGroupState(hSimConnect, temp.id, SIMCONNECT_STATE_ON);
SimConnect_SetInputGroupPriority(hSimConnect, temp.id, SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE);
/////////////////////
where <temp.id> is a unique serial number and <name> is the axis string name.
Here's how I'm turning it off:
SimConnect_SetInputGroupState(hSimConnect, id, SIMCONNECT_STATE_OFF);
SimConnect_RemoveInputEvent(hSimConnect, id, name);
id == same serial number as used to turn it on
What am I missing? Or is it (hopefully not) that Simconnect just doesn't take kindly to my incessant masking/unmasking?
Any guidance will be very much appreciated,
Farley
I'm writing a simconnect client and want to turn on and off certain joystick and keyboard inputs. Specifically, I'm masking the Joystick input and using it to control a tug instead of the aircraft, but of course, I only want to mask it while in "tug mode". It works great, but after maybe 5 cycles or so it stops working, and I'm unable to mask to get the joystick info. Is there a built-in limit to how many times you can request and unrequest or mask and unmask, or am I not using the right functions?
This is how I'm turning it on:
SimConnect_MapClientEventToSimEvent(hSimConnect, temp.id);
SimConnect_AddClientEventToNotificationGroup(hSimConnect, temp.id, temp.id, true);
SimConnect_MapInputEventToClientEvent(hSimConnect, temp.id, name, temp.id, 0, SIMCONNECT_UNUSED, SIMCONNECT_UNUSED, true);
SimConnect_SetInputGroupState(hSimConnect, temp.id, SIMCONNECT_STATE_ON);
SimConnect_SetInputGroupPriority(hSimConnect, temp.id, SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE);
/////////////////////
where <temp.id> is a unique serial number and <name> is the axis string name.
Here's how I'm turning it off:
SimConnect_SetInputGroupState(hSimConnect, id, SIMCONNECT_STATE_OFF);
SimConnect_RemoveInputEvent(hSimConnect, id, name);
id == same serial number as used to turn it on
What am I missing? Or is it (hopefully not) that Simconnect just doesn't take kindly to my incessant masking/unmasking?
Any guidance will be very much appreciated,
Farley
