Build Your Own Arcade Controls Forum

Main => Main Forum => Topic started by: SpaceParanoid on November 25, 2025, 05:04:43 pm

Title: Best practices mapping arcade buttons to scripts?
Post by: SpaceParanoid on November 25, 2025, 05:04:43 pm
I'm exclusively using Autohotkey to do some stuff on button presses but finding it doesn't listen specifically enough for the correct button press mapped to a specific PCB pin.

I have a script that, when you hit LT or RT on my PACTO PCB (each one is mapped from the Player 2 LT/RT pins to an arcade button on my CP) it creates a nice gui of a volume bar and raises and lowers the volume. Problem is that every reboot sometimes pressing those buttons triggers 2JoyZ +/- and sometimes 1JoyZ +/-....seems like Windows 11 just randomly switches depending on which button gets recognized first on boot. Do I need to add a layer of Joy2Key in there or can I listen for something other than 2JoyZ? Or perhaps some other solution entirely?
Title: Re: Best practices mapping arcade buttons to scripts?
Post by: SpaceParanoid on November 25, 2025, 07:26:40 pm
In case anyone comes across this, I did end up getting it working much more reliably by using Autohotkey in conjunction with JoyToKey:

1) Map hotkeys for the "Xbox controllers" in JoyToKey (several specific P1 and P2 pins on my PACTO tech board which I want to each do something different in a AHK script)

2) Having my AutoHotkey scripts just listen for those hotkeys instead of trying to listen for the buttons directly.

3) JoyToKey seems to maintain P1 and P2 designations for the correct pins on multiple reboots (for now at least....I've never messed around with it till today).

So that works. Was just curious if this is a common workflow or if I am missing a more tried-and-true method.
Title: Re: Best practices mapping arcade buttons to scripts?
Post by: PL1 on November 25, 2025, 08:38:19 pm
Sounds like you're running into the Windows device renumbering problem.

Windows assigns the first gamepad joystick it sees on bootup as Joy1, the second as Joy2, etc.
- It also does the same with mice, which can cause a problem if you have multimouse enabled in mame.ini.

You might want to look into either the ControllerRemap utility https://forum.arcadecontrols.com/index.php/topic,108767.0.html (https://forum.arcadecontrols.com/index.php/topic,108767.0.html) or MAME's newer devicemap function. https://docs.mamedev.org/advanced/devicemap.html (https://docs.mamedev.org/advanced/devicemap.html)


Scott
Title: Re: Best practices mapping arcade buttons to scripts?
Post by: SpaceParanoid on November 25, 2025, 09:22:33 pm
Great, thank you. I hadn't heard of the ControllerRemap utility, will look into it.