HiDTH / FltSim-msfs2020-Control

Control Microsoft Flight Simulator 2020 cockpit buttons and functions from a mobile device or tablet using Touch Portal
33 stars 1 forks source link

Checking Flightsim is in 'Focus' #6

Open Photosbykev opened 3 years ago

Photosbykev commented 3 years ago

Hi, Firstly love the template for the flight sim, it has change how I can interact it with the sim, great work.

Looking at some of your virtual keypresses that aren't using simconnect I can understand that the Flightsim needs to be the programme in focus before those virtual keypresses are accepted as MS haven't fully opened up the SDK and Simconnect functions (yet).

I use multiple screens for flying, main screen is the sim and then another two touch screen monitors are used for navigation programmes and such. If I don't return the focus to the flightsim before pressing one of the virtual keypress functions the action is missed by the sim.

Is it possible, on those buttons that are still need to use the virtual keypress, to refocus the Flightsim before the virtual keypress is sent as part of the button press action?

regards Kev

HiDTH commented 3 years ago

Hi Kev

This is very much an issue I am aware of as I sometimes have the same problem. I will speak shortly with the author of the touch portal Simconnect plug-in to see if he automate the functions which are currently missing.

regards

Denham (HiDTH / taxtips)

Photosbykev commented 3 years ago

There is some functionality in the tp-essentials plugin that might do the job but I've tried to use that to get the focus back onto the Flight sim but it didn't work (for me).

best regards and please keep up the great work Kev

mpaperno commented 2 years ago

Unfortunately this is a pretty big issue with MSFS in general and how they implemented "multiple screen" support with the external windows which steal focus. There's nothing really the MSFS TP plugin can do to address this issue specifically, besides some kind of tricks to get focus on the main sim window... which I imagine tp-essentials plugin already tries (I haven't used it myself).

About all we could do (in the TP plugin) is keep adding "native" actions so they don't require a virtual key press.

HiDTH commented 2 years ago

There is a Touch Portal Plugin available which will let you focus a particular application window:

Touch Portal Win Essentials Plug-in by Touch Portal With this plugin you can: Focus an application Close an application Open specific windows services such as windows alarm, administrator tools, sound settings and printers and devices

https://www.touch-portal.com/assetsdb/assets-details.php?id=1&name=Touch%20Portal%20Win%20Essentials&type=plugin

mpaperno commented 2 years ago

There is a Touch Portal Plugin available which will let you focus a particular application window:

Hi Denham,

Have you tried this plugin specifically for this issue with MSFS? I think @Photosbykev was saying that's what he tried and it didn't work for him. That's also the plugin I was talking about, but I haven't tried it myself.

Thanks, -Max

HiDTH commented 2 years ago

I just managed to get it working this morning - not sure how reliable it will be though. I needed to follow the instructions at https://discord.com/channels/548426182698467339/709326274891350058/709326989860929566 regarding powershell as Administrator. I also named the window to focus as FlightSimulator and restarted my computer before it worked - there is also a 3 second time delay before the window comes into focus - which could be a bit of a pain if sending keystrokes to the Sim.