Hello,
I am trying to write a little bit of SimConnect code that does the following.
1. Detect that the ATC window has been made visible by FSX's built-in ATC (happens whenever new ATC messages come in)
2. Obtains the current simulation rate
3. Sets the current simulation rate to 1x
4. Pauses the simulation
Items 2., 3. and 4. seem relatively trivial. Does anybody have any idea how to accomplish 1.? I have tried to subscribe to event "KEY_ATC", but that only fires if the window is activated by the user by pressing the ATC hotkey, but not if the window is activated by the simulator as new ATC messages come in.
To give you some additional context of what I am trying to achieve: I have the issue that when I am doing long-haul flights under IFR rules with increased simulation rates (unfortunately I don't have the time to fly these in real-time), ATC expects responses with increased rate as well (unfortunately I can't increase my own body's 'simulation rate'
), so if I am not paying attention and reset the simulation rate instantaneously after an ATC message has come in, the air traffic controllers get aggravated and eventually cancel my IFR plan.
I would therefore like my bit of code to detect that a new ATC message has come in, immediately reset the simulation rate to normal, and optionally pause the simulation, giving me time to react to the message, after which I can then increase the simulation rate again.
I thought I would be able to detect incoming ATC messages through the state of the ATC window. I can manually close the ATC window myself before going to increase simulation rate. If a new ATC message comes in, the window pops up again automatically, so I thought I would somehow be able to detect that in my SimConnect code and react to the event, but I don't seem to be able to find any hints on how to detect state changes of the ATC window.
Does anybody know how to achieve this? I have the fleeting suspicion that you are going to say that this is not possible, but any help would be greatly appreciated!
I am trying to write a little bit of SimConnect code that does the following.
1. Detect that the ATC window has been made visible by FSX's built-in ATC (happens whenever new ATC messages come in)
2. Obtains the current simulation rate
3. Sets the current simulation rate to 1x
4. Pauses the simulation
Items 2., 3. and 4. seem relatively trivial. Does anybody have any idea how to accomplish 1.? I have tried to subscribe to event "KEY_ATC", but that only fires if the window is activated by the user by pressing the ATC hotkey, but not if the window is activated by the simulator as new ATC messages come in.
To give you some additional context of what I am trying to achieve: I have the issue that when I am doing long-haul flights under IFR rules with increased simulation rates (unfortunately I don't have the time to fly these in real-time), ATC expects responses with increased rate as well (unfortunately I can't increase my own body's 'simulation rate'
I would therefore like my bit of code to detect that a new ATC message has come in, immediately reset the simulation rate to normal, and optionally pause the simulation, giving me time to react to the message, after which I can then increase the simulation rate again.
I thought I would be able to detect incoming ATC messages through the state of the ATC window. I can manually close the ATC window myself before going to increase simulation rate. If a new ATC message comes in, the window pops up again automatically, so I thought I would somehow be able to detect that in my SimConnect code and react to the event, but I don't seem to be able to find any hints on how to detect state changes of the ATC window.
Does anybody know how to achieve this? I have the fleeting suspicion that you are going to say that this is not possible, but any help would be greatly appreciated!
