Jump to content
The simFlight Network Forums

Change Focus to undocked Cockpit View


Recommended Posts

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.