ED:Runner. A help program for VR headsets with joysticks/HOTAS, part 2.

Update 2018-11-15 to version 2.0.

The old thread, https://forums.frontier.co.uk/showthread.php/291322-ED-Runner-A-help-program-for-VR-headsets-with-joysticks-HOTAS is locked for some reason, so here is a new thread =)

What is this? In its core, its a program to make sure Elite Dangerous (or any other game if you like...) does not lose focus when playing in VR or when using dual monitors for example. I originally wrote it because I hated when something stole focus in the middle of a game and I crashed into a star before I had time to refocus the game window. It does this by monitoring joystick inputs and as soon as it detects one, refocuses the defined window (Elite dangerous in this case).

I then kept building on it, although everything can be enable/disabled to your liking. Simply run it and an INI file will be created and opened in notepad. All the settings are explained in it.

You can define which joystick or joysticks to monitor and what inputs on said joystick to check for movement / button presses. You also have a defined joystick tolerance so that it does not react as a movement just because you bang your fist on your table, moving the joystick.

It also has the ability to change default sound device depending on if the game window is in focus or not, so if you watch youtube or something on your headphones, the audio will go to that if Elite Dangerous is not in focus. As soon as Elite is back in focus, the sound output is set back to the rift/vive/whatever. This function, even when disabled, is why it wants to run as administrator on launch.
You can also define a hotkey to switch it manually or change it to only switch manually (never automatic).

It can launch other programs when it detects that Elite is active. I always forget to start ED Market Connector and VoiceAttack, for example, so I just start ED:Runner now and when I launch Elite, the other programs are started automatically.

It can do a mouseclick in the Elite game window when it starts to shorten the intro. Hated waiting for that or searching blind for the mouse.

It can tell you to "look straight ahead" (definable) during Elite launch and then press a key to reset the headset (F12) by default.

It speaks! Yes. You can define, if you want, it to talk on various events. Elite focus lost? Say so! It will use the normal speech engine in Windows for this. Personally I payed for Cepstral David as I also use EDDI with VoiceAttack, but yeah. Up to you. Works just as fine with Windows default voices.
NOTE: If you can't seem to change the voice on a 64bit operating system, try running the 32bit speech properties: C:\Windows\SysWOW64\Speech\SpeechUX\sapi.cpl

Someone once said you can get rid of microstutter by setting the Elite process to high priority. So it can do that as well. And WatchDog64, Elites Anti-Cheat engine to Low priority. Not sure if this even does anything, but there it is.

You must define which joystick(s) to monitor. I've included a Joystick_Test program you can run. It will show up to 8 connected controllers and which ID they have. Then you know which number(s) to enter in the INI file that is created on first run of ED:Runner, so it knows which joystick(s) to monitor for movement.

NOTE! When running the Joystick_Test program, test by clicking somewhere else so the test program is not in focus. If you find that the test program stops reacting to joystick movement, you're probably using an XBOX controller of some sort. Microsoft have, at the time of writing, messed up the drivers in some patch so the joystick test program must be in focus to react to movement / button presses. This, of course, also affects ED:Runner and any other program you define should react (Push to talk for example).

There is a solution though. Downgrade your drivers for the XBOX controller. I've made a pretty little package that you'll find in the Xbox_Controller_Drivers folder with a ReadMe.txt once you've unpacked ED:Runner.

You will also find a Debug folder. Running that will bring up a command window, showing everything ED:Runner does. Personally I run that all the time because I think its fun to see what it does.

Download x64 version here: http://grandis.nu/downloads/ED_Runner_2.1.zip

For older versions, simply change to version number in the link from 1.0 and up. If you have need for a 32bit version, let me know...

Code:
  2.1:
  * Joystick_Test.exe improved codewise. Added version and architechture to the title as well.

  * If only one joystick was defined and it was not JoyID:0, it might crash when trying to detect movement if focus was lost. Fixed.

  * Added the ability to define parameters to RunPrograms applications. Just add another = after the .exe with the args you want. Example:
    VoiceAttack=C:\Program Files (x86)\VoiceAttack\VoiceAttack.exe=-reverseprofilepriority
    Or if you want multiple args, just use a space.
    VoiceAttack=C:\Program Files (x86)\VoiceAttack\VoiceAttack.exe=-reverseprofilepriority -listeningon   

 2.0:
    * JoystickID can now take a range of Controller IDs to monitor instead of just one. The default is still only one ID, but you can specify a range with, for example, 0-2 to monitor
      your first 3 controllers for movement. Observe that the range MUST start with 0.
      This will probably make it a little slower to react to movement. If you specify more than the number of controllers you have, nothing bad will happen. It'll just take even longer.
      Had to rewrite large portions of the program for this to work so it suits it well to be called 2.0.

    * Added MonitorDelay option to the Extras section. This controls how long to wait, in MS, between checking the joystick for movement when the game is not the active window.
      The default is 100 MS (Same as old versions) which makes it very quick to react to movements, but it might also take some CPU (Check task manager when game is not active).
      If you think ED:Runner takes too much CPU, try raising it a bit (start with 200).
      Setting it to 0 will make it mega responsive, but it will then take 8% CPU on an overclocked Intel 8700k ... Plus it might make it hard to break the JoyTolerance when it checks
      that often.

    * New Joystick_Test program that shows all controllers at once (well, 8 of them).

    * Compiled as x64 instead of x86. No more x86 support (As if anyone use that with VR anyway...)

    1.9:
    * ED:Runner is no longer paused when talking, with the help of a new "ED_Speak.exe" executable. That will do the talking while the main program keeps running instead of waiting
      for it to finish chatting. Some messages will still pause ("ED Start") and some will abort any current talking going on ("Game refocused" for example).

    * Added DoubleClickGameWindowDelayTune (TRUE/FALSE/RESET) to the Extras section. If TRUE, will give two beeps if DoubleClickGameWindowDelay is enabled, to help you fine tune the
      DoubleClickGameWindowDelay value you need to abort the intro at the best possible time.
      The first beep when the DoubleClickGameWindowDelay starts ... delaying and another higher beep when it actually clicks the game window.

      If you have voices off and/or the ""Reset Headset"" voice off, it will also give another, slightly higher pitched beep 1 second before clicking the ResetHeadSet button, if
      you have that enabled.
      So you know when to look straight ahead before resetting the headset position, even with voices disabled.

      If you have no voices enabled for "Reset Headset" but always wants this second beep to remind you to look straight ahead, set DoubleClickGameWindowDelayTune to RESET and it
      will always (only) beep one second before resetting the headset.

    * DoubleClickGameWindowDelay default value increased to 8 seconds. Seems right for my system. Can probably do with 7 seconds but 8 should be a better match for more people I guess.

    * Removed the "Double left clicking again in game window." action when DoubleClickGameWindowDelay is enabled. No reason for it anymore. Saves a second on startup time.

    1.8:
    * Reverted the WinTitleMatchMode change done in 1.7. Some people seems to have problems with "exact" match as it does not detect the game window when its running.
      Changed the default back to "Match the title from the start" mode but also made it an option as I like to have it in "Exact title match" mode.
      So added option WinTitleMatchMode in the extras section of the INI.

    * Added option LaunchProgramsWhenGameFound to the Extras section. If TRUE, LaunchPrograms are only executed once the game is found running. If FALSE (default), LaunchPrograms are
      started when ED Runner starts (As they did pre 1.6). If this is set to FALSE, CloseLaunchPrograms will always be set to FALSE as well (or it will just close the program again..)

    * LaunchPrograms can now be "remmed out" with a # in front of them. The two default programs added to the default INI on first startup are both remmed out by default now.

    1.7:
    * Added CloseLaunchPrograms=FALSE to INI. Setting this to TRUE will also close the programs started with LaunchPrograms, providing ED:Runner was the one that started it (wont kill
      anything if all programs in LaunchPrograms were already running when the game is detected as running).
    * WinTitleMatchMode changed. It now requires the exact names in EliteWindowTitle and LaunchPrograms. Previously it was partial match which could mess it up.
    * Fixed a potential crash at startup if it had not checked the defined controller for at least one loop already (rare occurance).
    * Removed "Activating Game" in the Voice section from the INI. Not used.
    * Added option OnlySwitchOnGameClosed to the AudioDeviceSettings section. When set to TRUE, it will not switch audio device when game focus is lost, only on game open, close.

    1.6:
    * If enabled, Output Sound Device should now always be from the VRAudioDevice if configured. It is only switched to NormalAudioDevice after elite is dead or lost focus and only after it
      finished saying what it should. Previously, you lost some messages in the VRAudioDevice as it got set to NormalAudioDevice too soon.
    * If enabled, on startup, if the game is not running, the output device is set to the NormalAudioDevice If the game is running, its set to the VRAudioDevice device.
    * If enabled, ProgramLaunch programs are now only launched once the game is detected and is checked on every restart of the game.
    * General:ResetHeadSet & Voice:Reset Headset added to press a key to reset the headset on start of the game (not when refocusing).
    * Example INI created on first launch (if no INI exists) for those who want a simple program that just monitors the joystick and do not care about all the other fluff.
    * INI file notes at the bottom updated and cleaned up a bit. Only applies if you start from scratch or delete your current INI so a new one is created.
    * If enabled, the DoubleClickGameWindowDelay function to skip the intro now sets the game window to AlwaysOnTop and activates it an extra time just to be sure that it does not try and
      click in any of the possible programs launched with ProgramLaunch. Sometimes they pop up above the game window.
    * If you accidentally hit your Windows Key or otherwise bring up your start menu, ED:Runner will fail to re activate the game window. It will detect the problem and if so, press ESC once
      to first close the start menu before trying again.
    * Program will no longer be paused automatically when clicking its traybar icon.
    * Added ManualAudioDeviceKey in the General INI file settings. This sets a hotkey that will manually switch between VRAudioDevice and NormalAudioDevice, if those two are defined.
    * Added NoAutomaticAudioSwitching to the General INI file settings. Setting this to TRUE will disable the automatic audio switcher. Useful if you only want to use the ManualAudioDeviceKey above
      to switch between the audio devices.
If you feel the urge to donate, there is a "donate" button in the Joystick_Test.exe =) Thanks!

NOTE: While this program can monitor more than one joystick/controller at the same time, if you only want a specific joystick for it to react to, you might notice that the IDs of your controllers are randomized at startup if they are USB. There is no way around this. Well, not natively. I did however write a program so solve this, forcing them into specific IDs, a while back that you might want to check out: ftp://misc:misc@grandis.nu/Tur-Game_Controller_Order
It was originally made for Arcade Cabinets that use USB controllers since emulators are notorious for wanting specific controller IDs when configuring the inputs but it works just as well for this. Most people will have no need for this!
 
Last edited:
In the next version, I will refocus the Elite window automatically before trying to click in it to skip the intro. Voiceattack or any other program you launch with [ProgramLaunch] might pop up in front of the Elite window so it clicks there instead.

Also, I will see if I can implement a way for it to reset the headset as well. I did not originally do that because that means you had to stare straight ahead when launching Elite, but we can leave it disabled by default. Personally, I just say "Reset headset" and VoiceAttack hits F12 for me, which resets it (and then my wife laughs at me for talking nerdy. "Power to engines damnit" =)

Both suggestions from Camlis.
 
Yeah, this is a really useful and easy to use program! :) Turranius did a great job and his support regarding my problem with the Xbox Controller was outstanding :)

I can recommend it to everyone (especially those with VR) using Alt-Tab to look things up and wanting to automate the startup routines for Elite. Its a great alternative to using an AutoHotkeyScript or doing everything manually :)
 
I like this.

The fact that it also starts up other programs that are not running when Elite starts is really nice too.

I have been using a Voice Attack commands to do that in the past, and now I can clear a ton of commands from that.

If you do not mind, I am going to show this off on stream, this is a very useful tool.
 
I do not mind Malic, of course not. Send me a link to the stream =)
Edit: Never mind. Found you

I like this.

The fact that it also starts up other programs that are not running when Elite starts is really nice too.

I have been using a Voice Attack commands to do that in the past, and now I can clear a ton of commands from that.

If you do not mind, I am going to show this off on stream, this is a very useful tool.
 
Last edited:
Update to 1.6 as promised.

Here is an update to version 1.6, linked in the first post.

NOTE: If all you're using this for is to activate Elite on joystick movement and you do not care about the other stuff, you do not need to update really. Its up to you (Looking at you, Malic. Hhehe).

Changed from 1.5:

INI file reordered a bit as the [General] section got a bit messy. I've moved the settings for switching audio device to its own section called [AudioDeviceSettings]. If upgrading, delete or rename your old INI and run 1.6 for a new one to be created.

Note: All settings can be disabled by either setting them to NA or just removing the whole line from the INI file.

ManualAudioDeviceKey added. This sets a hotkey you can press to manually switch to the "other" audio output device, depending on what is currently active. Default is Alt-PageUp but it can be changed in the INI. This requires that audio output switching is enabled so if VRAudioDevice and/or NormalAudioDevice is disabled with "NA" or not in the INI file at all, it wont work of course.

NoAutomaticAudioSwitching added. Simple TRUE or FALSE. FALSE is default. With it set to TRUE, automatic audio output switching is never done. If you only want to switch audio device manually with ManualAudioDeviceKey, you can set this to TRUE in the INI.

ResetHeadSet added. This defines a key that you have set in elite to reset the headset. Default is F12. It will simply press this key on launch of elite to reset the headset back to normal.
Reset Headset added. This is in the [Voice] section. Default is "Look straight ahead" and is spoken before pressing the ResetHeadSet key to remind you to look ... straight ahead. Of course, it requires that you have sounds enabled.

If you are using automatic audio output switching, all messages should now go to the VRAudioDevice. Previously, "focus lost" messages and such played on the NormalAudioDevice since it first switched it and then played the sound.
The audio output device is also set when launching ED:Runner. If elite is running, it switches to VRAudioDevice. If not, its set to the NormalAudioDevice.

Programs in [LaunchPrograms] are now only started if or when it detects that Elite is actually running. Previously they started at the launch of ED:Runner. So now you can start ED:Runner early without all the other programs popping up when elite is not running.
Programs are rechecked after game is lost and then found again, IE you restarted Elite (not on focus lost / regained).

The DoubleClickGameWindowDelay function that clicks the elite game window at launch of elite, to get rid of the long intro, could miss click if a program in [LaunchPrograms] started over the elite game window. That is now fixed by setting the elite game window to Always On Top a few seconds when trying to click in it.

If you hit your Windows key on the keyboard to bring up the start menu in the middle of a game, ED:Runner could not activate the game window again, no matter how much you moved your joystick or pressed buttons. Now, if it fails to move focus back to the game window, it will try to press ESC once to close the start menu and then try again.

The "Lost focus" voice is disabled by default on creation of a new INI file with a # in front of it. Since the program basically pauses while talking, it would be a pause before it could reactivate the game, causing frustration when you are in the middle of docking but it has to complete its phrase before monitoring the joystick. If you enable it, set the text spoken to something short!

Some more minor tweaks. INI file instructions cleaned up. ED:Runner will no longer automatically pause when clicking its traybar icon. On first launch, an "EXAMPLE Simple JoyMonitor.ini" file is also created that you can use if you simply want it to monitor the game window for joystick inputs and refocus it, without all the other stuff this script can do. When the game is not detected, it would pause for 5 seconds before checking again. This has been changed to 2 seconds.

Thanks to Camlis for testing it!
 
Last edited:
autoit error

i get an autoit error that reads : line 3554(file "c:\users......ED_Runner.exe") error: the requested action with this object has failed.

what does all of that mean?
 
When did that error show up? Can you paste your ini file as well please? Also, try the debug version and tell me the output near the crash.

i get an autoit error that reads : line 3554(file "c:\users......ED_Runner.exe") error: the requested action with this object has failed.

what does all of that mean?
 
Last edited:
Would it be possible to add and option to only switch audio when Elite starts and exits, and not when it loses or gains focus while it's running? Right now, when playing on my Rift and I start doing something in a browser through Oculus Dash, EDRunner switches audio back to loudspeakers, which is a bit annoying.
 
Would it be possible to add and option to only switch audio when Elite starts and exits, and not when it loses or gains focus while it's running? Right now, when playing on my Rift and I start doing something in a browser through Oculus Dash, EDRunner switches audio back to loudspeakers, which is a bit annoying.
Sure, shouldn't be too hard. I'll give it a go this weekend I hope.
 
Yes, I'd like to also add my thanks. My new WMR rig tends to dump me into the WMR home screen right at the most inopportune times in game. Takes me a minute or two to figure out how to get it back in focus. I even have a Voice Attack "Set focus" command that has worked before with my Rift but doesn't with this new setup. I'm going to install your program later today hopefully if I don't pack up the WMR headset and send it back.

To tell you the truth I'm not terribly impressed with WMR so far compared to my Rift. I like the sharper image although it's at the cost of narrower focus. But with the Rift I simply launched the game from the Oculus Library. With WMR I have to use the 3rd party app EDProfiler to start the game in VR, I have not found any other way. And instead of just running the Oculus app I have to run WMR, WMR for Steam, SteamVR, EDProfiler, and now your app. Not having to deal with external sensors is nice thou. But I've also got a bug I posted about where the "target what's in front of me" (keyboard "T") command doesn't work correctly. I usually have to go to the side panel. Other targeting commands like "next target", "highest threat", etc. work just fine. But not being able to target what my pipper is on is a big disadvantage. Sometimes it'll work but not usually. And it works fine if I unplug the WMR headset and play ED on the monitor. I think it's something in the WMR software causing this. I've tried to remap the keyboard and joystick buttons but no luck.
 
Awesome, thanks! And thanks for creating this, it's a great QoL improvement.
Possible for you to test 1.7 to see if its to your liking? I also changed some other stuff which was never released =)

Code:
    1.7:
    * Added CloseLaunchPrograms=FALSE to INI. Setting this to TRUE will also close the programs started with LaunchPrograms, providing ED:Runner was the one that started it (wont kill
      anything if all programs in LaunchPrograms were already running when the game is detected as running).
    * WinTitleMatchMode changed. It now requires the exact names in EliteWindowTitle and LaunchPrograms. Previously it was partial match which could mess it up.
    * Fixed a potential crash at startup if it had not checked the defined controller for at least one loop already (rare occurance).
    * Removed "Activating Game" in the Voice section from the INI. Not used.
    * Added option OnlySwitchOnGameClosed to the AudioDeviceSettings section. When set to TRUE, it will not switch audio device when game focus is lost, only on game open, close.
http://grandis.nu/downloads/ED_Runner_1.7.zip

Let me know.
 
Possible for you to test 1.7 to see if its to your liking? I also changed some other stuff which was never released =)

Code:
    1.7:
    * Added CloseLaunchPrograms=FALSE to INI. Setting this to TRUE will also close the programs started with LaunchPrograms, providing ED:Runner was the one that started it (wont kill
      anything if all programs in LaunchPrograms were already running when the game is detected as running).
    * WinTitleMatchMode changed. It now requires the exact names in EliteWindowTitle and LaunchPrograms. Previously it was partial match which could mess it up.
    * Fixed a potential crash at startup if it had not checked the defined controller for at least one loop already (rare occurance).
    * Removed "Activating Game" in the Voice section from the INI. Not used.
    * Added option OnlySwitchOnGameClosed to the AudioDeviceSettings section. When set to TRUE, it will not switch audio device when game focus is lost, only on game open, close.
http://grandis.nu/downloads/ED_Runner_1.7.zip

Let me know.
Awesome, I'll give it a try!
 
This is a great addition to ED!

I do not use VR, but this works great on multi-monitor setups as well to snap focus back to ED quickly. (eg when popping out of hyperspace)

I am now able to use my 4th monitor above the main, because it no longer matters if my mouse cursor gets lost up there as my flight stick can get me quickly back to game focus.

Also using it to launch a few apps and the ED Luancher. Supremely handy when coupled with desktop shortcut keys. =)

The only real tweak I needed to make was to filter out a few of the default axes and ended up with just X,Y and buttons. Using Throttle on full range mode was snapping focus when I was trying to use a web browser, it's hard to set it top dead center in my deadzones all the time, but it was quick and easy enough to ignore that one as well as the rudder pedals.

Thanks a bunch!
 
Glad to hear it, thanks! Did not even think that it might be useful for a multi monitor setup as well =)

As for the Throttle, yeah, I also only check the X,Y and buttons but for other reasons. You should not need to set the throttle back to dead center though, thats a bit weird. It can be full and ED Runner should not react, as long as the numbers do not change.
Not that it matters much because you're happy anyway, but you can try the joystick test programs and have a look at the throttle numbers. Do they move by themselfs without you moving the throttle? That is probably why ED runner is reacting to it. Should be able to compensate that using the JoyTolerance in the ini file (raising it up quite a bit). JoyTolerance have no effect on the buttons but it will make it harder to focus back to Elite using the stick (Have to yank it quite hard if JoyTolerance is very high).

Just posting it for future reference in case someone have the same problem =)


This is a great addition to ED!

I do not use VR, but this works great on multi-monitor setups as well to snap focus back to ED quickly. (eg when popping out of hyperspace)

I am now able to use my 4th monitor above the main, because it no longer matters if my mouse cursor gets lost up there as my flight stick can get me quickly back to game focus.

Also using it to launch a few apps and the ED Luancher. Supremely handy when coupled with desktop shortcut keys. =)

The only real tweak I needed to make was to filter out a few of the default axes and ended up with just X,Y and buttons. Using Throttle on full range mode was snapping focus when I was trying to use a web browser, it's hard to set it top dead center in my deadzones all the time, but it was quick and easy enough to ignore that one as well as the rudder pedals.

Thanks a bunch!
 
Last edited:
Glad to hear it, thanks! Did not even think that it might be useful for a multi monitor setup as well =)

  • ED : Runner works REMARKABLY well with a multi-monitor setup, you should really post elsewhere other than the VR forum for exposure. Even as I type this, I'm hitting my boost button on the throttle to bounce me back to the game after each hyper-jump.

As for the Throttle, yeah, I also only check the X,Y and buttons but for other reasons. You should not need to set the throttle back to dead center though, thats a bit weird. It can be full and ED Runner should not react, as long as the numbers do not change.

  • It's the "full Range" mode in game that's why it needs to be at top dead center for zero throttle. I have an ample dead zone there, but still it's tricky to keep it from jittering on the edges if it's not perfectly set in the deadzone. I'd imagine it's some form of jitter that was triggering it. Same with my foot pedals.

Not that it matters much because you're happy anyway, but you can try the joystick test programs and have a look at the throttle numbers. Do they move by themselfs without you moving the throttle? That is probably why ED runner is reacting to it. Should be able to compensate that using the JoyTolerance in the ini file (raising it up quite a bit). JoyTolerance have no effect on the buttons but it will make it harder to focus back to Elite using the stick (Have to yank it quite hard if JoyTolerance is very high).

  • I set tolerance to 300 for the flight stick. It seems perfect! Didn't need to bother fiddling with the throttle tolerance, I know what is happening there. :)

Just posting it for future reference in case someone have the same problem =)
On another note, If I could stop playing ED, I need to play around with v1.7.

1.3 works fine, but 1.7 is not launching programs. I'll generate a new .ini and play around with it more later, got station repairs to be done!

Question about setting lines to "comment" or "remark" - usually it's ; or # to rem out lines, does this work with EDRunner? Some lines I would like to disable without actually deleting them for future reference. I realize I can generate another .ini for reference, but still. heh

I plan on using the v1.7 to hotkey the manual audio toggle. I often switch between headset and speakers so that would be handy if I'm understanding how it works. Speaking of, the help file mentions:

If you do want to use it however, right click on the Volume Mixer in the traybar and select "Playback devices" or "Open Sounds Settings".
I have custom names for these audio devices such as "G35" etc.. Do custom names work or does it have to be the actual device name? eg "Logitech G35 Gaming Headset" etc ?
 
Ok, my update on v1.7

I will keep trying, but I spent a bit of time working with it, and no matter what I try, I get "Game not found, idling" every time.

1.3 works perfectly.

/shrugs.
 
Top Bottom