ridgeskimmer Posted November 14, 2018 Report Posted November 14, 2018 Hi, Can anyone help with this issue? I'm using multiple monitors with P3D. One main monitor has the P3D running on it and others have addons running in them i.e Fs Flight control, Vatsim, etc. When im working in one of those monitors then they become the "Active" screen and if i then press a key command for then main P3D flight sim it doesn't work as that, at that time, is not the "Active" screen. I have to first move the mouse over to the P3D monitor and click on there. This is a faff on! So my Question is, is there anyway of assigning a button command using FSUIPC to revert back to P3D as the "Active" monitor or is there any other work around? Many thanks for any suggestions Regards
John Dowson Posted November 14, 2018 Report Posted November 14, 2018 Hi, you could try using a simple lua script, such as: h = ext.gethandle("name") --name is program name incl .exe, or program title (as listed in Task Manager) ext.focus(h) Save the above to your modules folder as, say, "usexxx.lua" where xxx suggests the program you are switching to, then, in FSUIPC, assign your button or key to Lua usexxx. Cheers, John
ridgeskimmer Posted November 14, 2018 Author Report Posted November 14, 2018 31 minutes ago, John Dowson said: So would the LUA be ext.gethandleP3D.exe ext.focus(h)? sorry I’m new to this! thank you
John Dowson Posted November 14, 2018 Report Posted November 14, 2018 I believe the exe is Prepar3d.exe (but open task manager with ctrl-alt-del to check), so it would be h = ext.gethandle("Prepar3d.exe") --name is program name incl .exe, or program title (as listed in Task Manager) ext.focus(h) John
ridgeskimmer Posted November 14, 2018 Author Report Posted November 14, 2018 So does it need ext. focus(h) at the end? What exactly do I type? Then how do I put that in modules folder?
John Dowson Posted November 14, 2018 Report Posted November 14, 2018 Quote So does it need ext. focus(h) at the end? What exactly do I type? Yes, of course it needs that. Its pretty simple - the first line gets the handle of the window that needs the focus, the 2nd line sets the focus to the window with that handle. Quote Then how do I put that in modules folder? You need to create a file with those lines using a text editor, such as notepad++ (better) or notepad. John
ridgeskimmer Posted November 14, 2018 Author Report Posted November 14, 2018 Many thanks John, unfortunately that hasn't done the job Regards Mike
aua668 Posted November 14, 2018 Report Posted November 14, 2018 Hi, ext.focus() without a parameter sets the focus back to FSX/P3D Rgds Reinhard
ridgeskimmer Posted November 16, 2018 Author Report Posted November 16, 2018 On 11/14/2018 at 9:00 PM, aua668 said: Hi, ext.focus() without a parameter sets the focus back to FSX/P3D Rgds Reinhard Thank you guys...now it works!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now