• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v6 Mapping joystick inputs

DragonflightDesign

Resource contributor
Messages
1,107
Country
northernireland
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:
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);
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.
 
Too much wood for the trees (or not enough whiskey - can't decide just yet). The AXIS events and the answer to the POV question are under the General Functions topic in the SDK - "joystick:0:pOV:n:". It looks like you can play guessing games with joystick:0:button0 to joystick:n:button:n: but that's no use if you don't know what hardware is going to be attached. I'm no longer bothered about the buttons because I'm getting the museum to insert a USB mechanical mini-keyboard into the simulator gubbins and soldering wires from that to some "vandal-proof"
:rotfl:
buttons which can then be assigned to keyboard inputs by SimConnect.
 
Last edited:
Back
Top