OnCourse Software
http://www.ocs-support.co.uk/forums/

pf3_display keypress?
http://www.ocs-support.co.uk/forums/viewtopic.php?t=2135
Page 1 of 1
Author:  johnbla [ Sun Jul 17, 2016 4:25 am ]
Post subject:  pf3_display keypress?

Hi

Is their any way to use a keypress to bring either the pf3_display or remotetext to the front and back again? I do not have a second monitor, but run P3D in windowed borderless mode. Switching between P3D and the pf3_display means I have to minimise P3D every time, which is very unrealistic.

At this stage, I am still using the demo mode.

Many thanks
John

Author:  ThomasAH [ Sun Jul 17, 2016 9:19 am ]
Post subject:  Re: pf3_display keypress?

You can use a autohotkey script or, if you have the registered version of FSUIPC, a lua script for this.

As an example, I have the following FSUIPC lua script to to switch to VirtuaWin desktop #2 and focus FSX if I press any button on my yoke or joystick:
function focusfsx(joynum, button, downup)
  if not ext.hasfocus() then
    handle = ext.gethandle("VirtuaWinMainClass")
    ext.postmessage(handle, 1034, 2, 0)
    ext.focus(0)
  end
end
event.button("Y", 255, "focusfsx")
event.button("J", 255, "focusfsx")
(I have PF3_Display running on virtual desktop #1, so I can switch to it by using a VirtuaWin hotkey, in my case Flag key + 1, but when I switch back to FSX using Flag key +2, sometimes FSX does not have focus, because of that I wrote above script)

But you can ignore the VirtuaWin stuff and just use ext.runif to start PF3_Display, which returns a handle. You can then use ext.focus(handle) to focus this window. Perhaps ext.gethandle can be used for this, too, but I'm not sure.

If you want to use autohotkey (free as in free beer and free speech), you could search for "autohotkey focus window" to get some ideas how to configure it.

Author:  johnbla [ Sun Jul 17, 2016 11:28 am ]
Post subject:  Re: pf3_display keypress?

Many thanks.

J

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited