DragonflightDesign
Resource contributor
- Messages
- 1,157
- Country
I've just had an interestingly frustrating afternoon with this... I'm writing some software for an aircraft museum that has a set of really simple simulators in it (think: throttle, yoke and a handful of pushbuttons on the yoke). The problem I've been having is trying to figure out just which inputs are available using my own X52 setup to practice on. The following chunk of code is from the SDK joystick.cpp example:
The throttle control on the X52 is not joystick:0:slider; it's joystick:0:ZAxis. That was easy enough to figure out and I'm assuming (not yet tried) that the rudder pedals are going to show up as joystick:1:. Where or how do I get a list of the available buttons and sliders? POV gives you the first hat, but the X52 has three hats. POV1 or POV 1 doesn't work. The idea for the museum piece is that first thing in a morning as stuff is powered up, the staff can push, pull and click and the software will report any faulty inputs.
Code:
// Map input events to the private client events
hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_Z, "z", EVENT_Z);
hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_SLIDER, "joystick:0:slider", EVENT_SLIDER);
hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_XAXIS, "joystick:0:XAxis", EVENT_XAXIS);
hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_YAXIS, "joystick:0:YAxis", EVENT_YAXIS);
hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_RZAXIS, "joystick:0:RzAxis", EVENT_RZAXIS);
hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_HAT, "joystick:0:POV", EVENT_HAT);