Using my HTC Vive controllers in AutoHotkey

(or: tool assisted smugging)

When I got my HTC Vive Pro I was disappointed at the lack of script-ability when it came to automation or really any kind of programatic hook, and scouring Reddit only found me a tool for using the Oculus Rift through AHK, which seemed unfair especially given it’s extreme inferiority. This greatly annoyed me, given how badly I needed to make a shortcut to start and stop recording in ShareX to assist me in smugging on people who make better financial choices than me, so I made this.

Searching around on Google eventually found me this, a script able to get HTC Vive controller inputs live, and print the events, so I quickly augmented this with the python win32api to emulate keypresses, and much to my surprise it worked perfectly, so far I’ve already completed my initial goal of taking screenshots and videos with ShareX entirely from VR, and will soon move on to making more smugging tools through controller shortcuts.

You can use the virtual keypresses in anything, besides a few applications that won’t recognize it as a shortcut due to the keycodes not being registered to anything.

An example of usage would be this simple AutoHotKey script, which will activate if you press right menu, left grip, and right grip, and will run an awkwardly long key combination you might want to bind in ShareX.