Overwrite joystick

#1
hi all,
how can you override joystick input in simconnect so that you can switch it off upon a condition?

thanks

(sorry wrong forum can the moderator move it please?)
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#2
Hi,

I moved it to the SimConnect forum, maybe you get a better response there.
 
#4
Assuming you already know you way around the SimConnect examples, the procedure is this:

Map the event (using aileron as an example):
Code:
	hr = pSimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_X,"AXIS_AILERONS_SET");
Add it to a notification group:
Code:
	hr = pSimConnect_AddClientEventToNotificationGroup(hSimConnect, INPUT_GROUP, EVENT_X,true);
Set the input group so you can mask it from the sim using this (so only your client gets the input, not the underlying sim):
Code:
hr = pSimConnect_SetNotificationGroupPriority(hSimConnect, INPUT_GROUP, SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE);
Then you can trap it in your SimConnect callback function like this:
Code:
    case EVENT_X:
		dwData = (long)evt->dwData;
		val = dwData;
Then you can do what you like with it. To send a new or modified axis position to the sim in its place, do this:
Code:
pSimConnect_TransmitClientEvent(hSimConnect,SIMCONNECT_OBJECT_ID_USER,EVENT_X,(DWORD)val,SIMCONNECT_GROUP_PRIORITY_STANDARD,SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
Hope that helps,

Si
 
Top