Alhard Horstmann Posted October 19, 2021 Report Posted October 19, 2021 Hi all, I am flying with P3D and an A320 on two monitors. I separate my undocked cockpit view on the second monitor. On my Master monitor runs the main P3D process with main panel view. So I have two views running. I change the views with FSUIPC and my controller buttons. Now I want to change the view on the second monitor e.g. from cockpit view to spot view. But before I do this, I have to click on the second monitor in order to get focus on that screen. Then the view change works by controller buttons. Now my question: what FSUIPC function can I use to change the focus to my second screen, before I change the view by controller button with a key sequence and FSUIPC? My term "focus" always means the MS Windows process focus. Thanks and regards Alhard
Pete Dowson Posted October 19, 2021 Report Posted October 19, 2021 4 hours ago, Alhard Horstmann said: Now my question: what FSUIPC function can I use to change the focus to my second screen, before I change the view by controller button with a key sequence and FSUIPC? Sorry, this is not anything FSUIPC can do at present. The Lua library functions for programs loaded by Lua (ext.run function) include focus facilities, but not for individual windows within a process, and certainly not for P3D itself. You could perhaps do it with a Lua plug-in which uses the mouse library -- mouse.move to more the cursor to a suitable position, then mouse.click to set the focus there. I can't think of any other way. Pete
Alhard Horstmann Posted October 27, 2021 Author Report Posted October 27, 2021 On 10/20/2021 at 12:34 AM, Pete Dowson said: Sorry, this is not anything FSUIPC can do at present. The Lua library functions for programs loaded by Lua (ext.run function) include focus facilities, but not for individual windows within a process, and certainly not for P3D itself. You could perhaps do it with a Lua plug-in which uses the mouse library -- mouse.move to more the cursor to a suitable position, then mouse.click to set the focus there. I can't think of any other way. Pete Thanks, Pete, I will try with mouse.move. Haven't found any solution yet. Alhard
aua668 Posted October 28, 2021 Report Posted October 28, 2021 Hi, I assume, the window on the second monitor is an undocked window. In that case you could try to use this LUA code: local lhandle = ext.gethandle( "PUT YOUR WINDOW TITLE HERE" ) ext.focus() -- select main application window ipc.sleep(100) -- wait some time ext.focus(lhandle) -- set the focus to the window ipc.control( 66860) -- replace the parameter with the number found in the P3D controls list (VIEW CAMERA SELECT x) Rgds Reinhard
Alhard Horstmann Posted October 29, 2021 Author Report Posted October 29, 2021 Hello Reinhard, das ist genau , was ich brauche. Thats exactly what I need. I have LUA experience and will try it asap. There are all undocked windows on the other monitors. rgds Grüße nach Graz.
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