Jump to content

Archived

This topic is now archived and is closed to further replies.

geodirk

SIMCONNECT PAUSE_ON/PAUSE_OFF really doesn't work

Recommended Posts

Anyone know why trying to set any of the pause events for FSX (on, off, toggle) doesn't work in SimConnect? All my other events for lights, radio buttons, switches, etc. work fine. Is the pause key read only maybe? FSData.MapClientEventToSimEvent(EVENT_ID.KEY_PAUSE_ON, "PAUSE_ON"); FSData.TransmitClientEvent(1, EVENT_ID.KEY_PAUSE_ON, 0, GROUP_ID.GROUP0, SIMCONNECT_EVENT_FLAG.DEFAULT);Thanks, Dirk

Share this post


Link to post
Share on other sites

Hi Dirk, I gave it a try, it worked perfectly. I used the sample from the SDK named InputEvent and changed one line :hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_BRAKES, "pause_on"); It works also with pause_off and pause_toggle. Patrick.

Share this post


Link to post
Share on other sites

Hi Patrick, It must be a C# thing then because I can get everything else to work for a Cessna 172 except just the pause toggle/on/off. I created a simple C# example showing the issue here if anyone wants to verify the bug: https://www.wuala.com/geodirk/FSX_Public/?key=eWWqH7ouzi8F Patrick - what version of Microsoft.FlightSimulator.SimConnect,dll are you using? Is it more recent then: version=10.0.61259.0 that I'm using? Thanks, Dirk

Share this post


Link to post
Share on other sites

Hi Dave, Nope - I'm not in multiplayer mode but just the Freeflight mode. Like I mentioned before, all my other calls to lights / gauges work just fine. Not sure why only the pause key seems to be a problem. Can anyone else check my C# code and verify that it is not working for them either? - Dirk

Share this post


Link to post
Share on other sites

Hello Dirk, I had a look at your code. The problem is in the instructions such asFSData.TransmitClientEvent(1, EVENT_ID.KEY_PAUSE_ON, 0, GROUP_ID.GROUP0, SIMCONNECT_EVENT_FLAG.DEFAULT); The 1 after the left parenthesis means that you send this event to the user object. PAUSE is not an event related to an object but to the simulator. Just replace the 1 by zero.FSData.TransmitClientEvent(0, EVENT_ID.KEY_PAUSE_ON, 0, GROUP_ID.GROUP0, SIMCONNECT_EVENT_FLAG.DEFAULT); I also noticed this instructionIntPtr Handle = (IntPtr)FindWindow(null, "Form1"); IMO, this is not a good practice. Actualy, I changed the name of the window to form1 in place of Cessna 172R because it was the name that appears in the window. It would be better to create the FSData object in the Form1.cs and pass it as an argument or a global variable. With these changes, it works fine. Patrick.

Share this post


Link to post
Share on other sites

Hey Patrick, Thanks SO much for the insights. I can confirm that it's all working properly now. Your explanation of using a '0' over the '1' now makes perfect sense as to why all my other controls (lights, gauges, etc.) were working but pause was not. Also appreciate the other suggestions. I'll refactor my code to do the argument passing better. Thanks again! - DIrk

Share this post


Link to post
Share on other sites

×
×
  • Create New...