Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

2 post in one day, I'm on a roll :)

This one is a bit more complicated so bare with me...

I've created an AHK script that will launch one EXE if an HID device is present, if the device is not present it will run another EXE

Background:

I have 2 Project 64's setups, one for using my Adaptoid's and the other for using my wireless Xbox 360 controllers.

I could have mapped both pads to the same keyboard keys using Xpadder but then I would lose analogue support.

I've created the script to be pretty generic so it will run any EXE not just Project 64

How to:

You need to edit 3 variables at the top of the script:

VID = VID_06F7

NotFoundEXE = E:\N64\Project 64\Project64.exe

FoundEXE = E:\N64\Project 64 - Adaptoid\Project64.exe

VID is the device ID, you can get this in device manager (see screenshot)

NotFoundEXE will be ran if your device is not found

FoundEXE will be ran if your device is found

The script will pass any arguments that it receives to the EXE that it runs, so this can be used as a direct replacement for your current EXE.

Note:

I've tested this on 3 systems, it worked on 2 and failed on 1. Seems to be a problem getting the HID devices on some systems, so it may or may not work for you. If it fails it will pop up and tell you. I found all the HID part of the code on the AHK forums so I've no idea how to fix it.

DeviceExist.zip

post-1567-0-37928900-1344810128_thumb.pn

  • Like 2
Posted

Another quality share! Thanks Stu!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...