Jump to content
Sign in to follow this  
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 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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...