• 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.

MSFS Input

Messages
4
Country
unitedstates
Hello everyone, this is my first post on FSDeveloper. I am an senior full stack developer and I've had a passion for flight sims since the mid 80s. I've mostly focused on military combat sims, but I've recently joined the world of MSFS 2020 and I must say I'm really enjoying it. I recently purchased the Fenix A320 and decided I wanted to program my Stream Deck to control most of the switches on the A320. Well I came to learn that apparently this is not so simple to do without 3rd party tools. I downloaded the MSFS SDK and have been looking at the documentation, but I'm not having much luck getting some of the sample applications to work (they compile, run and connect (simconnect) but I get nothing back from the sim. Anyways I was hoping I could get pointed in the right direction on this forum. What I want to do is the following: Write an application that allows a user to select any switch specific to any aircraft, then program it to send a specific keystroke. The user would create a full profile and activate the profile and when they press a programmed keystroke it would send that command (event??) to the sim. Of course that application can later be enhanced to work off of actual switches (I'm familiar with Sharp DX for input has I have built my own cockpits and written my own tools to test my controller devices). I just need to figure out how to interface with MSFS 2020 so I can send events to set switches. Also would like to be able to write an app that captures these input events, so for example if I turn on the left battery, I would like to receive that event in the app so I can identify it.

Any help would be greatly appreciated. Thank you.
 
I appreciate the responses. I'm familiar with both of these. What I would like is to write my own. Any thoughts on how to proceed?
 
Also would like to be able to write an app that captures these input events, so for example if I turn on the left battery, I would like to receive that event in the app so I can identify it.
Not so easy. Essentially to capture events you need to subscribe to that particular event. If you want to capture every event then you need to subscribe to every single event (of which there are hundreds).

See SDK/Samples/SimConnectSamples/InputEvent

This all becomes somewhat moot though as MSFS is switching towards preset input events which I don't believe you can capture with simconnect at all. These are events which start with B:

See https://docs.flightsimulator.com/ht...nitions.htm?rhhlterm=presets&rhsearch=presets

You can see the input events of a particular aircraft using the BehaviourDebug tool in dev mode menu in MSFS - Windows.

Not to mention H: events for communicating with html/js gauges.
 
Anthony31 Thank you so much for that post. That points me in the direction that I need. I will give that a try and share my results here.
 
Update:

I found exactly what I needed in this thread: Simconnect and WASM

Checking the Behavior Debug tool, I found that most if not all of the Fenix switch positions are stored in LVars. In order to read and write LVars you need to create a Web assembly module (WASM) and then a client using SimConnect to interact with it. A WASM basically is like a DLL. You install it in the community folder.

Then as Anthony31 pointed out above, you need to subscribe to the event. Then you can read and write to that event as needed. I downloaded the code from the above link from github and got it working rather quickly without too much hassle. The author of the above thread goes through every detail step by step. Very easy to follow. A big thank you to the thread author HBilliet.
 
I know I’m late to the party, just ordered my Stream Deck + today. There’s a great 3rd party program for Stream Deck that can give you a lot more customization and may help you.

We’ve used it to build a full broadcast switcher with page after page after page of custom buttons and settings. I’ll try and talk with my friend who’s a broadcast engineer in the morning and find out the website for you.
 
Back
Top