Sign in to follow this  
Guest steels214

throttle control

Recommended Posts

HelloI have most of the examples in the sdk working. But there are a few that I can't get to work. One of them being the throttle control. It says you're supposed to hit "A" and "Z" to move the throttle. These two buttons actually control the view and ap in fsx. The real problem is that the example program doesn't see these events happening, so it just loops. Is there something missing from the code???By the way, I have the same problem wit the setdata program too. ctrl+shift+a is supposed to move my aircraft to a different lat/lon. But again, the example program never sees this event happening.Thanks

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Did you give that 'example program' input focus or is this intercepting FS key strokes ? (Sorry, I'm asking w/o ever having seen the SDK).Cheers,Siggy

Share this post


Link to post
Share on other sites

The code has a small bug - once it gets the simstart event it asks for object data for the throttle but it listens for object data by type. This means it never hears the answer and just hangs.The fix is simple, on line 54 remove the _BYTYPE so that the line reads: case SIMCONNECT_RECV_ID_SIMOBJECT_DATA:After that it works just fine (to test it you need to press the A and Z in the simulator window and you will find that it changes both the view and increases the throttle when you press the A key).

Share this post


Link to post
Share on other sites

Sorry it took so long for me to respond. Been Kind of busy lately.Anyway, I changed that line of code but it still doesn't work. An event is never received so it never goes into the callback function.Here's the output from SimDiagnostic:1. Open: Version=0x000000001 Name="Throttle Control"2. AddtoDataDef: DefineID=0, DatumName="GENERAL ENG THROTTLE LEVER POSITION:1", UnitsName="percent",DatumType=4,fEpsion = 0.0,DatumID=-13. SubscribetoSystemEvent:EvetnID=0,SystemEventName="SimStart"4. MapClientEventtoSimEvent:EventID=1, EventName=""5. MapClientEventtoSimEvent:EventID=2, EventName=""6. MapInputEventtoClientEvent:groupID=0,dzInputDefinition="A",DownEventID=1,DownValue=0,UpEvent=-1,UpValue=0,bMaskable=07. MapInputEventtoClientEvent:groupID=0,dzInputDefinition="Z",DownEventID=2,DownValue=0,UpEvent=-1,UpValue=0,bMaskable=08. SetInputGroupStat:GroupID=0,dwState=09. AddclientEvetnNotificationGroup:groupID=0,EventID=1,bMaskable=010. AddclientEvetnNotificationGroup:groupID=0,EventID=2,bMaskable=0On the client side, it just waits for an event but none ever come.Any ideas?Thanks

Share this post


Link to post
Share on other sites

It looks like there is no "SimStart" event in the output. Until that SimStart happens the program just loops.To get the SimStart event either start the SimConnect program before you start a flight or change airports during a flight (changing the aircraft probably triggers a SimStart too, I just haven't tried that yet).Hope that works for you ...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this