ATC Window focus

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Locked
virtuali
Posts: 598
Joined: Tue Sep 27, 2011 12:51 pm

Post by virtuali »

Hello,



I finally managed to install P3D, and wanted to report a small issue:



When opening the ATC Window with the standard keyboard @ hotkey, and then closing it using either the keyboard again or by clicking on the "X" with the mouse, the focus is not returned to the main window, so a subsequent keypress to open the ATC menu again will not work, unless you *click* anywhere on the main window to bring it back to focus.



The same happens when the window is created by Simconnect as a custom menu.



In both cases, it would be preferred if the focus returned automatically to the main window as soon the ATC or the custom Simconnect-created window gets closed, which is also consistent to how FSX works, so it has an impact on cross-compatibility.
Umberto Colapicchioni - VIRTUALI Sagl
http://www.fsdreamteam.com
WBard
Posts: 1034
Joined: Mon Aug 16, 2010 7:23 pm

Post by WBard »

Thanks for bringing this to our attention. We are aware of this issue and have already begun addressing it. It is logged in our internal tracking system and will be addressed.
virtuali
Posts: 598
Joined: Tue Sep 27, 2011 12:51 pm

Post by virtuali »

Just wanted to report, this hasn't been fixed in the 1.3.3708 release.
Umberto Colapicchioni - VIRTUALI Sagl
http://www.fsdreamteam.com
virtuali
Posts: 598
Joined: Tue Sep 27, 2011 12:51 pm

Post by virtuali »

More exactly: it has been fixed, but for the ATC menu window only. If the menu is created via Simconnect, the focus is still not returned to the main Window after closing it.
Umberto Colapicchioni - VIRTUALI Sagl
http://www.fsdreamteam.com
Michael Semeniuk
Posts: 81
Joined: Mon May 09, 2011 5:35 pm

Post by Michael Semeniuk »

Hello Umberto,

I'm sorry to hear that the SimConnect issue has not been resolved on your machine. I have just redone the quality checks to ensure that the Mission Window, SimConnect Window, ATC Window, and Multiplayer Chat Window refocus on both Windows 7 and XP for 1.3 and all of them refocus correctly.



Can you verify that the issue for the SimConnect window not refocusing exists in the TextMenu C++ sample in our SDK?

1) If it refocuses in the sample but not in your particular use case then can you describe how you are using the API?

2) If it doesn't refocus even in the sample, what OS are you running, computer specs, and any add-ons are you running?



Thank you very much and hopefully we can get to the bottom of this!



Software Developer - Prepar3D® Team
virtuali
Posts: 598
Joined: Tue Sep 27, 2011 12:51 pm

Post by virtuali »

I wasn't able to compile the project with the P3D SDK, because the compiler (VC++ Express 2010) that is configured to open the "Prepar3D SDK.SLN" file, gives me an error 1033 can't open program database ''



However, there's a TextMenu c++ sample coming from the FSX SDK and that compiles just fine with VC++ 2005, which I normally use. Comparing the two .CPP source codes, the only differences are the message "Connected to Flight Simulator" that was changed into "Connected to Prepar3D" so I guess we should say the two source codes are identically for all purposes.



The sample has a menu that is being created by pressing CTRL+F1, this works fine and just the same in FSX and P3D. If I select an item from #1 to #5, the menu closes reporting the item selected, and this works fine too, both in FSX and in P3D



BUT



by pressing CTRL+F2, the menu is supposed to be closed without any choice made, and a "Removed from Queue" message will appear on the console. This WORKS on FSX, but it DOESN'T on P3D, showing exactly the same problem I've reported.



Pressing CTRL+F2 on FSX, it works right away, but in P3D, the event is not triggered, until the main P3D Window is clicked to bring it back in focus! After I do that, the CTRL+F2 closes the menu, and I can see the "Removed from Queue" message on P3D too.



This means, there's clearly a difference in behavior with the same source code.



But there's more, I don't even think this has anything to do with Simconnect, and it's not even an issue of just returning the focus when exit a menu. Yes, that was a problem with P3D 1.2, the focus wasn't returned when the ATC Windows was closed, now it is, but that's not the whole issue:



The main issue is way more deep, and it's a matter of basic program behavior, which is different from FSX, and I should have noticed it earlier: in FSX, while a text window (ATC or Simconnect-created, it's the same) is displayed, the program STILL accepts all its normal input keys. For example, opening the ATC window in FSX and then pressing the "S" key to cycle views, works in FSX without any issues.



In P3D, instead, opening the ATC Window, will just stop processing all the input keys, except those used by the menu itself UNLESS one clicks the main Window to restore it in focus! The same test, opening the ATC menu, then pressing "S" to cycle views, doesn't work immediately in P3D, but it works after clicking on the main Window with the ATC Window still open.



This is the real issue: and it's quite confusing, since I don't see any reason to stop processing al the sim keys if a window is open, since the input can be restored in any case by bringing the main window back into focus.



Umberto Colapicchioni - VIRTUALI Sagl
http://www.fsdreamteam.com
jordanmoore
Posts: 2
Joined: Tue Oct 19, 2010 11:48 pm

Post by jordanmoore »

You can run the C++ TextMenu example by right clicking the TextMenu project heading and selecting Properties->Linker->Debugging and changing "Debuggable Assembly" to No (/ASSEMBLYDEBUG:DISABLE). It runs as described, but does appear to suffer from the focus problem. (v. 1.4).
Locked