Skip to content

Instantly share code, notes, and snippets.

@xhecksum
Created July 27, 2017 07:20
Show Gist options
  • Save xhecksum/d1da8e1db5f927c79a6e5f58801f6691 to your computer and use it in GitHub Desktop.
Save xhecksum/d1da8e1db5f927c79a6e5f58801f6691 to your computer and use it in GitHub Desktop.
ahk script check if game is running then autolaunch steamvrwheel
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Loop
{
; check if steamvr is running.
If ProcessExist("vrmonitor.exe") and !ProcessExist("cmd.exe"){
; new if statement for each game
If ProcessExist("X-Plane.exe") {
Run "C:\Users\..\Desktop\steam-vr-gamepad.bat - Shortcut"
}
If ProcessExist("Il-2.exe") {
Run "C:\Users\..\Desktop\steam-vr-gamepad.bat - Shortcut"
}
If ProcessExist("DCS.exe") {
Run "C:\Users\..\Desktop\steam-vr-gamepad.bat - Shortcut"
}
}
; steamvr is closed but wheel is still running. close steamvrwheel
If !ProcessExist("vrmonitor.exe") and ProcessExist("python.exe"){
Process,Close,python.exe
}
If !ProcessExist("vrmonitor.exe") and ProcessExist("cmd.exe"){
Process,Close,cmd.exe
}
; run this loop every 5000. peformance?
Sleep 5000
}
ProcessExist(Name){
Process,Exist,%Name%
return Errorlevel
}
@xhecksum
Copy link
Author

xhecksum commented Jul 27, 2017

This script automaps the Vive wands to be a gamepad when you launch a game.

Works with steam-vr-wheel script found here
https://github.com/mdovgialo/steam-vr-wheel

Instructions:
install Autohotkey and put this script in the Windows 10 startup folder.

You need to edit game list starting at line 14. and change the hard coded paths to steam-vr-gamepad.bat - Shortcut (needs to be a shortcut)

@mdovgialo
Copy link

Cool stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment