Discussion Small script to focus desktop windows for VR users

I play Elite with a HOTAS using Joystick Gremlin. Hence, because of the way the particular profile is set up, if I am off focus from Elite, the Joystick does not function.If I drag my browser window to VR, I can find it difficult to focus on it or use my mouse to navigate through it (in part because of the way the mouse works in Elite) and when I do get a focus on the window, it can be equally difficult to refocus on Elite. I'm aware there is a script out there to refocus on Elite if the joystick moves, but as my Joystick is 'bound' to the Elite window, I cannot use it.

So I wrote this script to easily cycle focus through the 3 windows I generally use when playing ED:
1) Firefox (EDDB, Coriolis, Spansh, etc);
2) EDMC Market Connector;
3) Elite Dangerous;

On a middle button press, the script will cycle through each of the above windows and place the mouse cursor at the centre of same window. The middle button will check the following conditions on each press:
1) Is Oculus client running? (Script will exit if not in VR) (You could edit the script to reflect what type of headset you are using - Valve, HTC Vive, etc)
2) Is Elite Dangerous running? (If not will exit)

The script will autoexit if it detects that Elite is no long running after a a minute or so has passed.

The script is pretty basic and no doubt could be improved with other functions also...but it works well enough for me. Hopefully other VR / Joystick Gremlin users can make use of it.
(Lines 18 & 19 of Focus.ahk will need to be edited to reflect where you have installed Elite Dangerous)

[EDIT] Merged the two files into one for simplicity.
 

Attachments

  • Focus.zip
    1.3 KB · Views: 134
Last edited:
Back
Top Bottom