Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Switchable controls idea  (Read 1278 times)

0 Members and 1 Guest are viewing this topic.

DracoDan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13
  • Last login:February 27, 2019, 09:55:31 am
  • I want to build my own arcade controls!
Switchable controls idea
« on: January 07, 2013, 10:44:58 am »
History (non-technical):
I've been working for quite a while on my arcade cabinet (some day I'll get around to posting some pics and details) and after getting my CP done, I started thinking about how I wanted to wire it.  I had originally bought a mini-pac for key encoding, but later on after learning about how a keyboard acts versus a joystick/control pad, I decided that I would rather use a joystick encoder instead and bought a pair of ZD encoder boards.  After thinking about it further, I decided that I wanted to somehow do both of these and have it easily switchable.

Technical:
My first idea was to use something like this 24 pole double throw relay to switch all the buttons at once, but then I realized that since both are negatively grounded, I should just be able to switch the grounds to change the inputs from going to one encoder to the other.  I think there could be a couple of problems with this though, which I describe below.

Example setup:
Encoder A has its ground connected, encoder B does not.  there is a single NO button with one side connected to SW1 of both encoders and the other side connected to a switch that switches between the common ground of encoder A or encoder B.

First potential problem:
When button 1 is pressed, SW1 of encoder A is pulled low, does this mean that SW1 of encoder B would drain (be pulled low) to SW1/ground (since the button being pressed means they're now connected) of encoder A and detect a key press?  My guess is yes...  If so, is there an easy way to avoid this?

Second potential problem:
I fear that connecting the positive terminals of both encoders together would cause unpredictable and erratic behavior.  Although both controls have 5v positive, there is the high likelihood of there being small differences in circuitry that could cause a small voltage difference between the two, possibly causing one or the other to detect that a button is always being held down.  An easy way to fix this (I think) would be to use an array of diodes on all the positive terminals, ensuring nothing drains to them.

Let me know if my description is too confusing and I'll throw a quick block diagram of my idea together.

Thanks!

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9273
  • Last login:August 19, 2025, 03:10:32 pm
  • ...
Re: Switchable controls idea
« Reply #1 on: January 07, 2013, 10:55:14 am »
After thinking about it further, I decided that I wanted to somehow do both of these and have it easily switchable.

I'm all for cool technical projects, but why? 
What can a keyboard encoder do that a gamepad encoder can't?  And vice-versa?

DracoDan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13
  • Last login:February 27, 2019, 09:55:31 am
  • I want to build my own arcade controls!
Re: Switchable controls idea
« Reply #2 on: January 07, 2013, 12:54:09 pm »
my concern with the keyboard controller is with key repeat when a key is held down.  After some research I learned that you can use the accessibility options to disable key repeat, but then the problem is the opposite, some games are designed for you to hold certain buttons down.  The best solution from what I've read is to use a joystick encoder instead, and this is when I decided to purchase the ZD encoder.

The problem with the Joystick/ZD encoder, is that hyperspin doesn't currently (from what I read) support joystick input.  Many builders get around this by adding another control just for game selection, but my cabinet is designed to be as slim as possible, the CP measures only 8" x 30" (total cabinet depth is under 20").  In fact, I'm having to put the 1P, 2P and coin buttons on the screen bezel as I simple don't have any more room on my CP without crowding the game controls.  While I am considering the option of adding a tiny joystick and buttons to the bezel for game selection, I would REALLY like to avoid this... I like a clean look!

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9273
  • Last login:August 19, 2025, 03:10:32 pm
  • ...
Re: Switchable controls idea
« Reply #3 on: January 07, 2013, 01:13:52 pm »
I've never heard of the key repeat issue before.  ???
Is there a specific emulator this is an issue with?

I'm sure there are a ton of Hyperspin users using only gampads.
Have you tried using a program like joy2key, xpadder, or autohotkey to have the ZD encoder post as keyboard keys?

brad808

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 818
  • Last login:May 22, 2023, 08:18:15 pm
Re: Re: Switchable controls idea
« Reply #4 on: January 07, 2013, 01:40:31 pm »

I'm sure there are a ton of Hyperspin users using only gampads.

I do it on one of my cabinets. Works the exact same as my other cabinet that uses an ipac. No other programs or modifications needed.

Sent from my Galaxy Nexus


PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9685
  • Last login:Today at 02:47:50 am
  • Designated spam hunter
Re: Switchable controls idea
« Reply #5 on: January 07, 2013, 01:52:05 pm »
What can a keyboard encoder do that a gamepad encoder can't?  And vice-versa?
On some emulators like Visual Pinball, you can't edit some of the control keystrokes, including esc for exit.  With a gamepad encoder, you to need to use Xpadder or Joy2Key to get those keystrokes. (Potentially problematic when you use a portable controller like the one in my sig on different systems.)

Also with gamepad encoders, you might need DrVenture's program to keep a particular encoder ID tied to a particular player position when unplugging and re-plugging -- never an issue with keyboard encoders.

First potential problem:
When button 1 is pressed, SW1 of encoder A is pulled low, does this mean that SW1 of encoder B would drain (be pulled low) to SW1/ground (since the button being pressed means they're now connected) of encoder A and detect a key press?  My guess is yes...  If so, is there an easy way to avoid this?
Ground is ground so both inputs will pulled low.  No easy way to avoid this.

I fear that connecting the positive terminals of both encoders together would cause unpredictable and erratic behavior.
No problems from what I've seen.

I've tied inputs together to give both upper flippers and Magnasave from one button press.

My first idea was to use something like this 24 pole double throw relay to switch all the buttons at once

Why not use an encoder that has both functions?

With the KADE, you can program your choice of 20 primary inputs (keyboard or gamepad functions) and 20 shifted inputs. (primary input + HWB Hardware Button) 

The only downside is that I just checked the KADE HID joystick programmable firmware and there are 13 buttons, D-pad, and L/R analog sticks available, but it is just for one HID device, so you would need two KADEs for two players. (May also require DrVenture's program mentioned above.)

Connect HWB to a rocker switch, toggle switch, sliding switch, or a latching pushbutton to switch from primary inputs to shifted inputs.

The other option is to use software conversion like BadMouth suggests.


Scott

DracoDan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13
  • Last login:February 27, 2019, 09:55:31 am
  • I want to build my own arcade controls!
Re: Switchable controls idea
« Reply #6 on: January 07, 2013, 03:31:12 pm »
<snip>
First potential problem:
When button 1 is pressed, SW1 of encoder A is pulled low, does this mean that SW1 of encoder B would drain (be pulled low) to SW1/ground (since the button being pressed means they're now connected) of encoder A and detect a key press?  My guess is yes...  If so, is there an easy way to avoid this?
Ground is ground so both inputs will pulled low.  No easy way to avoid this.

I fear that connecting the positive terminals of both encoders together would cause unpredictable and erratic behavior.
No problems from what I've seen.

I've tied inputs together to give both upper flippers and Magnasave from one button press.

My first idea was to use something like this 24 pole double throw relay to switch all the buttons at once

Why not use an encoder that has both functions?
With the KADE, you can program your choice of 20 primary inputs (keyboard or gamepad functions) and 20 shifted inputs. (primary input + HWB Hardware Button) 
The only downside is that I just checked the KADE HID joystick programmable firmware and there are 13 buttons, D-pad, and L/R analog sticks available, but it is just for one HID device, so you would need two KADEs for two players. (May also require DrVenture's program mentioned above.)
Connect HWB to a rocker switch, toggle switch, sliding switch, or a latching pushbutton to switch from primary inputs to shifted inputs.
The other option is to use software conversion like BadMouth suggests.

Scott
Thanks for the suggestions, seems like the problem is pretty much exactly what I feared.

After thinking about it, I'm probably going to go with a 24PDT switch that I can hide under my CP. that will switch all inputs for both players or two 12PDT to allow each player to switch independently.  I my also give Xpadder a shot, I hadn't heard of it before.

I love the idea of using the KADE, I had never heard of it so I looked it up and did some reading.  Looks like it's a kickstarter project that is mostly sold out; unless I'm missing something it doesn't look like they've reached general availability yet.  The other problem is that I've already invested in both a mini-pac and the ZD encoder boards.

My biggest hindrance on completing this entire project is that I keep going back and redoing various parts.  I have already made the decision that I will not again significantly change my design, since every time I do I seem to find as many new limitations as my change aimed to relieve.  Between that and the fact that I'm a perfectionist, I am already afraid that this will never get finished...

Drnick

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1642
  • Last login:June 21, 2024, 03:32:31 pm
  • Plodding Through Life
Re: Switchable controls idea
« Reply #7 on: January 07, 2013, 03:36:47 pm »
See the following for my fix on the hyperspin joystick issue that I think you are referring.  I should point out that Joystick control works fine with the exception of exiting a menu. and this is only an issue if you are not using admin buttons and so want to use 2 keys to exit.

OK firstly you want a copy of xpadder 5.3 which was the last of the freeware versions of xpadder.  You should be able to find it at download.hr

Run xpadder and create a joystick setup which I imagine will be much like mine, 1 joystick and 8 buttons. I only set mine up for the player 1 side, not much point in setting up on both.  Save the Joystick setup and it will automatically load that when it detects the controller. (Which should be always as unless its a fight stick its not going to be removed).

You then right hand click on whichever button you have assigned as your P1 coin button (in my instance Button8) you need to change the option for set selector to Selects set 2 and choose the option for when held (you will get a little blue bar at the bottom of the button that says 2 with an arrow next to it), If you press the arcade button selected then you will see it changes to a 1 and that the selected set in bottom right will change to 2.
Choose set 2 (bottom right) and click on whichever button you have assigned as your P1 start button (in my instance Button7) and set this to esc.

You should now find that when holding down P1 credit and then Pressing P1 start sends an esc command to exit Menu/Hyperspin.

I can confirm in my testing with Mame that the credit button works as normal and it still works for exit with both credit buttons pressed together. Please note I have only tested that this works with Mame, I have not tested with any other emulators. I am unsure if it will work in conjunction with other emulators, but any emulator that uses Joystick commands should be fine.

I think they should remove the options for using more then 1 key for exit in the joystick function of hyperhq

DracoDan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13
  • Last login:February 27, 2019, 09:55:31 am
  • I want to build my own arcade controls!
Re: Re: Switchable controls idea
« Reply #8 on: January 07, 2013, 03:49:19 pm »

I'm sure there are a ton of Hyperspin users using only gampads.

I do it on one of my cabinets. Works the exact same as my other cabinet that uses an ipac. No other programs or modifications needed.

Sent from my Galaxy Nexus

Good to know, I guess I'll try this first and go back and redo things if I have any issues.  Luckily my controls can be easily removed in case I want to redo the wiring.

Thanks again for all the advice!  I'll try and get a project thread together soon, I have probably 50 pictures of the build so far.

DracoDan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13
  • Last login:February 27, 2019, 09:55:31 am
  • I want to build my own arcade controls!
Re: Switchable controls idea
« Reply #9 on: January 07, 2013, 04:21:08 pm »
See the following for my fix on the hyperspin joystick issue that I think you are referring.  I should point out that Joystick control works fine with the exception of exiting a menu. and this is only an issue if you are not using admin buttons and so want to use 2 keys to exit.

OK firstly you want a copy of xpadder 5.3 which was the last of the freeware versions of xpadder.  You should be able to find it at download.hr

Run xpadder and create a joystick setup which I imagine will be much like mine, 1 joystick and 8 buttons. I only set mine up for the player 1 side, not much point in setting up on both.  Save the Joystick setup and it will automatically load that when it detects the controller. (Which should be always as unless its a fight stick its not going to be removed).

You then right hand click on whichever button you have assigned as your P1 coin button (in my instance Button8) you need to change the option for set selector to Selects set 2 and choose the option for when held (you will get a little blue bar at the bottom of the button that says 2 with an arrow next to it), If you press the arcade button selected then you will see it changes to a 1 and that the selected set in bottom right will change to 2.
Choose set 2 (bottom right) and click on whichever button you have assigned as your P1 start button (in my instance Button7) and set this to esc.

You should now find that when holding down P1 credit and then Pressing P1 start sends an esc command to exit Menu/Hyperspin.

I can confirm in my testing with Mame that the credit button works as normal and it still works for exit with both credit buttons pressed together. Please note I have only tested that this works with Mame, I have not tested with any other emulators. I am unsure if it will work in conjunction with other emulators, but any emulator that uses Joystick commands should be fine.

I think they should remove the options for using more then 1 key for exit in the joystick function of hyperhq

Great!  Thanks for the info and details for configuring Xpadder.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9685
  • Last login:Today at 02:47:50 am
  • Designated spam hunter
Re: Switchable controls idea
« Reply #10 on: January 07, 2013, 04:59:05 pm »
I love the idea of using the KADE, I had never heard of it so I looked it up and did some reading.  Looks like it's a kickstarter project that is mostly sold out; unless I'm missing something it doesn't look like they've reached general availability yet. 
KADE release is scheduled for about a month from now, once Kickstarter supporters get their rewards.

It uses the same AVR as Degenatrons' earlier AVR Encoder and I think he still has some of those with the .1" screw terminals for sale or you can solder two 12-pin headers on this AVR or this AVR and use 6 of these 4 wire .100 header wiring harness with .187" crimp cables.  Once the Kade releases, you can easily upgrade the firmware.

The other problem is that I've already invested in both a mini-pac and the ZD encoder boards.

My biggest hindrance on completing this entire project is that I keep going back and redoing various parts.  I have already made the decision that I will not again significantly change my design, since every time I do I seem to find as many new limitations as my change aimed to relieve.  Between that and the fact that I'm a perfectionist, I am already afraid that this will never get finished...

You'll never get perfection in 1 build -- too many compromises.

Don't worry, you'll use any leftover various parts in one of the many projects you will eventually decide to build.   :lol


Scott