Jump to content
LaunchBox Community Forums

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
Link to comment
Share on other sites

  • 3 years later...

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. 

Link to comment
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
Link to comment
Share on other sites

  • 1 month later...

I don't know how tf I missed this response man. I am a little embarrassed that I did. I appreciate he time you took to type out your post, you are clearly very passionate and proud about your build, as you should be. It is phenomenal.

So, here is my computer case, it is built into an ikea end table for a very unassuming and stealth pc, it has since (taking these pics) undergone quite the transformation, ie: all new hardware inside. I have it connected to a Sony STR-DN1080 Atmos receiver, 55" Vizio 4k (can't remember the model number) and my speakers are the Klipsch 5.1 reference pack plus 2 Bose Model 141 Series II Bookshelf Speakers for the Atmos height. I have 35tb total in ssd/hdd, gtx 1080 ti fe, 32gb ram, i7 6700k, ASUS Rog Maximus VIII Hero. It is whisper quiet and is exactly what I want. 

My setup is almost identical to yours including the inteset ir receiver, sans it's location as I don't use any kind of optical media drives. I have an older but superior (to the harmony line) remote made by Acoustic Research called the x-sight. It is a jp1 programmable remote, done on the pc. This, in combination with reg edits and an AHK script that I keep running in my system tray from boot, allows me to launch anything I want from my remote. If you are interested, I even got youtube tv (not the cable version but like what is on smart TVs) running in chrome (which is not normally possible on the pc) and launching from a remote keypress. I also have my 0-9 keys setup for text input when using YouTube on TV and YouTube kids. Text entry is just like the old flip phones. I would be happy to share my script(s) with you, if interested. It really gives the computer an appliance like feel. I also have an older Microsoft Wireless Entertainment Keyboard 7000 Model 1073 (copied and pasted that cause I can never remember the name) for better control of the system when needed inc launching kodi if I dont have my remote nearby or in-hand.

I am very well aware of the inherent issues of dinput/xinput and stick with xinput at all times. I am like you a bit of a purist. I have many wireless controllers, including:

  • DualSense (my newest baby and ofc for all my PS needs, until I find a viable and not ridiculously expensive wireless PS2 solution...for pressure sensitive buttons)
  • 2 Xbox one (using controller companion for mouse and the official xbone chatpad)
  • 2 x360
  • 1 x360 Hori RAP ex fightstick
  • 1 x360 PDP Marvel (wired) fight pad
  • 1 Power A wireless GC controller (dinput) I will be going with the wavebird and smash GC controller adaptor in due time)
  • 1 Retrobit BT Saturn Pad (xinput mode)
  • 1 Retrobit 2.4ghz Saturn pad (xinput mode)
  • 3 wiimotes+mayflash dolphin bar (didn't want to sacrifice a wii for its bt pcb plus the dolphin bar just works)
  • 1 8bitdo sfc30 (xinput)
  • 1 8bitdo n30 (xinput)
  • 1 8bitdo Xbox sn30 pro (dinput because they locked it down to android but am getting the 8bitdo bt receiver in the mail today to circumvent this)
  • 3 wired N64 controllers using a mayflash adaptors. (My time is coming to get the wireless one, but I will be doing the mod for swapping the guts with authentic n64 parts)
  • 1 steam controller (screw pinnacle game profiler, joy to key and xpadder, steam does gamepad remapping the best)

Though I have only 1 of many of these, I do plan on getting P2 controllers eventually, until then, they can use the xbox gamepad, if I am not playing...or use the other pads in xinput mode for a whacky exp. I can't wait for the Retrobit BT Dreamcast controller (whenever tf that gets released). Oh and my next purchase will be the Logitech g920 for...well, Cruis'n USA..obviously...? and forza and other driving games/sims.The Project is never truly over.

Also, I am not gonna lie, I skim read your post and started replying and talking about my setup. When I finished typing it out I scrolled back to the top to see if I missed anything and see that we used much of the same formatting. We are similar, so you are alright to me. lol

Link to comment
Share on other sites

Very nice setup, I really like the hidden cpu idea. I'm jealous at the amount of storage you have. I looked up that remote control, it looks awesome, I've been eyeballing ebay for nice programmable every once in a while I'll have to keep this one in mind! As for TV/youtube stuff I've been sticking with a few amazon firesticks, they really are awesome devices, a long time ago I was set on making an amazing htpc computer, but today's streaming technology really outpaced any progress I made on that grounds I have now have three of those sticks in my household.

I noticed I made a mistake there, I was mentioning I had PS2 controllers, what I actually have is PS3 controllers, which are essentially the same thing but wireless. But yeah, gotta make sure it's oem if you you want pressure buttons. I think PS4 controllers also have analog buttons, which may be a nice modern solution.

As for wii adapters, if mayflash works for ya, all the power to you. The adapters themselves can be found usually for pretty cheap if you're ever looking, you don't gotta rip apart a wii to get to one lol. I got two from alibaba or something for like $5 a piece in case I messed one up.

As for the 8bitdo receiver you're getting, I gotta warn ya (unless their firmware has been updated since then), it might make your pc think a controller is plugged in all the time, which might mess up your setup a bit.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...