Jump to content
LaunchBox Community Forums
Chadmando

AHK script for Windows 10, use center guide button to open big box, hold button down to turn off controller

Recommended Posts

I have a multi controller setup in the works and I am using the xbox one controller to run the Big box front end. I have tried several different programs and codes and they weren't working for me very well, also the latest version of AHK doesn't seem to read xbox one controller outputs. Looking online at several scripts I have finally discovered a way to accomplish this one seemingly simple thing:

Launch Big Box with a quick press of the center guide button on the Xbox one controller, alternatively holding down the button won't launch big box and will shut down the controller. When Big Box is the active window a quick press will close Big Box, holding down will simply turn off the controller (and keep launchbox open).

Pre-requisites:

-x keyboard button set as the hotkey to turn off BigBox  (in hotkey settings)

-Game Bar program disabled so the guide button doesn't launch this program.

-Use Auto hotkey version 1.0.48.05 (Otherwise this doesn't work for me)

-Set script to run at start up of computer.

 

The script is this:
-------------------------------------------------------------------------------------------

#IfWinNotExist, LaunchBox Big Box
$vk07sc000::
aDown:=A_TickCount
While GetKeyState("vk07sc000")
Duration:=(A_TickCount-aDown)
If (Duration<300)
run "LOCATION OF BIGBOX.EXE"
Else
{}
Return

#IfWinActive, LaunchBox Big Box
$vk07sc000::
aDown:=A_TickCount
While GetKeyState("vk07sc000")
Duration:=(A_TickCount-aDown)
If (Duration<300)
send, x
Else
{}
Return

-----------------------------------------------------------------------------------

 

  • Thanks 1
  • Unusual Gem 1

Share this post


Link to post
Share on other sites

This is simply brilliant!. Thank you for this. I will be using this for LB/BB as well as other purposes. Would you be willing to tell me more about your multi-controller setup? Currently, I have an 1-XBONE wireless, 1-Wired PDP XBONE, 2-X360 wireless, 1-Hori R.A.P. EX, 1-PDP VS Fighting Pad, 1-Steam cont., 1-8-bitdo SN30, 1 8-bitdo N30 (2nd gen), 1-Retrobit 2.4ghz Saturn pad, 1-A-Power Bluetooth NGC, 3 WiiMotes via Mayflash Dolphin Bar and 2- OEM N64 wired controllers with NGC Joystick replacements via Mayflash N64-USB adaptor. It may be overkill, but I want it to feel as original yet updated as possible (dependent on the game being played). I will soon be getting a racing wheel and pedals as well. I am wondering though, how do you tackle the usb id isues from unplugging/disconnecting etc? I found a video on YT by Ninja2bceen telling us about a program, I cannot remember the name of it, but it doesn't seem to work for me, so I got a usb hub with switches...it works but still hardly a console-like nor kid friendly "Family Acceptance Factor" experience. 

Share this post


Link to post
Share on other sites

Hello, You're welcome. This code may be outdated , I'm not sure or not if the window title is still called Launchbox Big Box, let me know if it works for you.

My controller setup is pretty much entirely wireless now, and they all work with Xinput mode, not dinput, controlled by by pc's built in bluetooth adapter, a couple do not use either Xinput or dinput and are exclusive to using the dolphin emulator only. The order in which the controller is turned on is the order windows sets the controller number. If I were to turn off a controller and turn on another; the one I just turned on will replace the previous controller number. It works well for me just like the current gen consoles do. If I mix dinput with Xinput, things just get too conflicting with certain emulators so I strayed away from that.

I have also installed an infrared receiver into my optical drive so I can control bigbox with a remote control, kind of like this one: https://www.amazon.com/Inteset-Internal-Applications-Motherboard-PC-IRS5-01/dp/B00VH02IZ2/ref=sr_1_12?dchild=1&keywords=Ir+Usb+Receiver+Windows+10&qid=1610599359&sr=8-12 which I might just replace with a bluetooth one in the future.

The remote control is kind of nice to use instead of a game controller to launch/close big box because some of my controllers do not have a guide button, I don't have to turn the remote control on, and it doesn't use up a controller spot. It's still set up so I can use either or though.

 

I am big on using the name brand/same style controllers if possible so my set up consists of this:

2 Xbox one wireless controllers

2 snes classic edition controllers with the internals replaced with the wireless 8BitDo Mod Kit https://shop.8bitdo.com/products/mod-kit-for-nes-classic-controller Used in Xinput mode

2 NES classic editon controllers with the internals replaced with the wireless 8BitDo Mod kit https://shop.8bitdo.com/products/mod-kit-for-snes-classic-controller Used in Xinput mode

2 8bitdo m30 controllers for genesis games https://www.8bitdo.com/m30/ in xinput mode (previously I was using the mod kit, but I really liked these ones, and I can use the extra button to launch bigbox)

4 retrobit wireless N64 controllers https://www.amazon.ca/retro-bit-Mobile-Controller-Wireless-Bluetooth-N64-Controller-Android/dp/B01M1KP9GT (Using software from their website to convert dinput to xinput)

2 oem PS2 controllers, controlled with one dedicated usb bluetooth adapter that works for Xinput mode. The set up is a little complicated with plugins and such so it doesn't conflict with my built in bluetooth adapter. If you need more info on this let me know. The end result is they behave the same as wireless xbox one controllers.

4 wii motion plus remotes dedicated to dolphin emulator

4 wireless wavebird controllers dedicated to the dolphin emulator

------

My dolphin gamecube/wii remote set up is a little (way) more complicated than the rest.

I gave up on the mayflash adapter to use the wii remotes to control bigbox, as I found it didn't work well for dolphin myself, and the LED's in the bar died out within a couple of months.

What I opted to use instead was an actual OEM wii remote bluetooth adapter and a USB sensor bar (the sensor bars can be found anywhere). I have installed it into a blank optical drive filler, with a sync button on the front.
Kind of similar to what this guy did here: https://www.youtube.com/watch?v=oV4hZxbOkXI You may be able to find someone on the internet that makes and sells these that you can just plug into a usb slot.

Using some tutorials and drivers on the internet It is dedicated to dolphin control only. I paid someone on kijiji to do the soldering for me because I suck at it.

For gamecube control I am using the wii u gamecube controller adapter https://www.amazon.com/Super-Smash-GameCube-Adapter-Wii-U/dp/B00L3LQ1FI/ref=sr_1_5?dchild=1&keywords=GameCube+Adapter+for+Wii+U&qid=1610602772&sr=8-5 installed into a 3D modelled optical drive holder https://www.thingiverse.com/thing:1948219 (I paid someone local to 3d print it for me). This is also dedicated to dolphin using drivers found on the internet. 

If you need information on this let me know.

This is my tower, https://forums.launchbox-app.com/uploads/monthly_2018_12/PCTower.jpg.0d13e1e5cf1fafe26e72156a452c313d.jpg the blue button is a sync button for wii remotes (so I don't have to play around with settings to sync them). Once synced they remain synced even after closing dolphin. And below the sync button is gamecube wavebird controllers plugged into the wii u adapter.

------

My set up is also a little overkill for must people but I am a bit of a purist as well.

All the controllers are interchangeable to control bigbox and whatever emulator I want to use it on (except for wii/gamcube controllers), I just turn it on and go.

The setup allows for analog button support in pscsx2 for ps2 controllers (I need it for my favorite ps2 game)
Perfect wii remote control and remote speaker sound for wii games.
Analog button support for gamecube games like Super Mario galaxy.

I am least happy with the n64 controller setup, no controller feels right to me except an oem brand n64 controller (the damned analog stick), but I still want it to be wireless. I'm hoping 8-bitdo or another 3rd party company comes along sometime in the future with replacement. Maybe Nintendo itself will create an N64 classic controller.

------

As for your set up, I would possibly recommend a dedicated wireless bluetooth remote control for bigbox itself if using on a television. I found it really convenient myself.

 I would recommend using xinput instead of dinput for everything you can for all things wireless (I think most 8-bitdo stuff has this check the manual), and set up your emulators the same way.

wii controller mode on the mayflash bar for for dolphin use only (I think that doesn't use a windows controller spot if I remember correctly).

As for the rest of the plug in devices I cannot say I have a good solution, so I am sorry. You may need to play around with different software/hardware. I can suggest a couple things:
 

If you have something you know you won't ever unplug that uses dinput (maybe xinput as well) I believe windows will keep the same controller order even during pc power cycles, as long as you don't unplug them. If you do lose that order by accident just unplug all the controllers and plug them in the order you want again when the pc is on.

I have used joytokey in the past for some devices and have it launch as the same time as bigbox https://joytokey.net/en/ to convert controller presses to keypad output, I believe this can utilize your controllers unique ID so it will always associate that controller for whatever keyboard output you desired.

I believe I may have also utilized a program  called controller companion for my setup but I can't remember ($5). It is a handy little program I always have running in the background at the start of windows for various things.

There maybe other programs out there that can use your unique hardware controller ID and convert dinput to a xinput.

If you cannot get it working as desired, maybe explore xinput wireless replacements. It really simplifies things a whole lot for the family acceptance factor you're talking about. My son was 5 years old when I set it up this way and he had no issues whatsoever.

 

Edited by Chadmando

Share this post


Link to post
Share on other sites

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...