DIY Button Box Help

Jay Archer

1RPM
Original poster
Dec 17, 2018
1
0
26
Just have a quick question. I'm building a button box for PC2 and iRacing. Ill be using a circuit board from an old PC controller. I was wondering what software I should use. My only concern is I the headlights on an acutall switch instead of a momentary button. I would like the lights to come on when I turn the switch on and off when I turn the switch off. Is that possible? Appreciate any help I can get!
 

Elaphe

500RPM
Aug 26, 2016
962
463
71
The problem is that the games don't work with switches (which would act as a button always pressed or not pressed at all). They wouldn't even know either the state of the switch when you restart the track. What most users do is a little trick: use a momentary switch (goes back to the initial position), which acts as a button but at least looks like a switch. It's not what you want, but I'm afraid it's the only solution as far as the games are programmed the way they are.
 

YardStick

1RPM
Premium
Nov 1, 2015
1
0
46
Elaphe is right. Switches are a bad idea.
But, as mentioned "self centering momentary toggle switches" do exist and those work just fine as buttons. (Google it for images.)

I bought few for my DIY button box for this exact reason. Mine are on-off-on switches so I could wire i.e. button 1 and 2 both in one switch. That way I can use one switch to adjust, let's say boost. Toggle up for more, and toggle down for less.

And btw, if you find it difficult to rewire and rebutton an old controller PCB, you might want to google up "zero delay arcade usb encoder." Those are cheap and easy to work with.

On software side you might want to look at JoyToKey. I purchased a license after I tried it out. Makes it easier to map everything properly in games.
 
Last edited:

Elaphe

500RPM
Aug 26, 2016
962
463
71
I've been thinking about it for a while and I've written a script in AutoHotkey to test it. This may work, but ony with games that don't switch the lights on automatically. It should be running in the background with a timer that constantly gets the switch state. If off, the code do nothing and returns. If on, it will send the key to toggle the lights on/off, which you must configure in your game, deactivates the timer and activates a new timer that does the same but checking then switch goes off. The same would be applicable for wipers, for instance. This will work, but the problem is when you leave the track with the switch on. Next time you enter your car, since the car lights are off by default in the game, the switch function would be reversed. How to overcome this problem? I don't know.
 

Emery

2000RPM
Jun 6, 2009
2,694
1,343
This will work, but the problem is when you leave the track with the switch on. Next time you enter your car, since the car lights are off by default in the game, the switch function would be reversed. How to overcome this problem? I don't know.
Yup, that's always been the problem for using a headlight switch. Somehow you need to get the state of the switch as the game believes it is set, which would mean a software plugin. I don't know if the headlight state is available in any games via the plugin interface.