Build Your Own Arcade Controls Forum

Main => Main Forum => Topic started by: Izrun on June 23, 2006, 10:58:20 am

Title: USB Keyboard hack question
Post by: Izrun on June 23, 2006, 10:58:20 am
I have a question about keyboard hacks (and I know that they are bad and a waste of time).  On Tiger-heli's keyboard hack page, it mentions that the USB keyboard driver will freak out if you press more than 6 keys simultaneously.  First off, is this still a problem with XP, or just a legacy issue (98, ME or 2k)?  Secondly, is this a six simultaneous key press limit per computer or per keyboard?  In other words, if I had two USB keyboards hooked up could I press 12 keys at a time without it freaking out? 

Thanks!
Title: Re: USB Keyboard hack question
Post by: Havok on June 23, 2006, 12:09:38 pm
I believe that is a limitation with USB.

But, with the cost of encoders being so cheap now, why bother hacking a keyboard?
Title: Re: USB Keyboard hack question
Post by: Izrun on June 23, 2006, 01:25:46 pm
But, with the cost of encoders being so cheap now, why bother hacking a keyboard?

Yeah, I know what you mean.  However, I was just tossing some ideas around in my head about ways to implement a hot swapable USB modular control panel that would not require any wires to ever be connected, so each modular unit would have it's own USB encoder.  At a couple bucks a pop this is reasonable, but 20 bucks is way to much (considering a joystick panel might only have 4 possible outputs going to it).  My next consideration is a bunch of gamepads, but then you run into more issues about assigning players (I think).  I probably will just implement my own HID device using a pic or something.  That way I could even make it more intelligent.

However, a USB limitation is still a little ambiguous.  Is that a USB per keyboard device limitation or system wide?  I suppose I might be able to test it with a USB hub and a bunch of unhacked keyboards.
Title: Re: USB Keyboard hack question
Post by: Havok on June 23, 2006, 02:08:45 pm
Sorry - to be at least a little more specific: that's a USB keyboard HID limitation, 6 keypresses at a time. Granted, if you only have a 1 player setup, this is not really an issue. It comes more into play when you have two or more simultaneous players on a game that requires multiple buttons\joystick maneuvers like Street Fighter, etc...

Theorectically, if you did put two keyboards in there, I would think you could double your "limit" - definitely something to try.

How many panels are you planning? It sounds like you will have a similar setup as me. I have a GPWiz for each swappable panel, except for my "Tron" panel - which has a spinner\trackball\joystick (i.e. optical interface + USB joy instead).

You may want to optimize controls to reduce the number of panels, and the number of interfaces required.

Or, you could do a funky setup like this:

http://www.beersmith.com/mame/ (http://www.beersmith.com/mame/)

Make sure to post a project announcement, and take lots of pictures!
Title: Re: USB Keyboard hack question
Post by: SirPeale on June 23, 2006, 06:45:02 pm
Keyboard hacks are *NOT* bad, depending on the use.  For a 4P CP?  Forget it.  For a 1P CP with a joystick and two buttons?  Works a charm.
Title: Re: USB Keyboard hack question
Post by: Lilwolf on June 23, 2006, 07:05:32 pm
its not a keyboard hack good / bad question.. .but specifically USB

the trouble with the USB keyboard hacks is the USB keyboard spec specifically says 6 keys.  So most keyboards will implement it specifically for 6 keys.  You might get a few more depending on the keyboard... but since no ghosting is specifically more expensive, most don't.

There are other hotswappable control panel options.  I went with building my own tac switches that connect with standard barrier strips (something like these Radio Shack Link (http://www.radioshack.com/product/index.jsp?productId=2103983&cp=2032058.2032231.2032289&allCount=10&fbn=Cable+type%2FBarrier+block&f=PAD%2FCable+Type%2FBarrier+block&fbc=1&parentPage=family) So the expensive parts where in the cabinet... but each control panel had a small 2 dollar barrier switch with easy wiring built in.

But after all that work, it wasn't all that bad plugging in the 2 db25 serial cables... and that was MUCH cheaper (buy M-M 25pin serial cables on ebay in bulk and cut them in 1/2 for the control panels.  Again a few bucks each)
Title: Re: USB Keyboard hack question
Post by: cmonkey on June 23, 2006, 11:12:42 pm
I think you were correct in assuming that the limit is per keyboard, and not system-wide.  However, I've never tried it myself.  Anyway, failing that, another plan would be using RJ45 (ethernet) plugs and jacks to make it modular and just having the encoder in the cabinet.  You could hook up 7 buttons per plug.

Peale, I'm using a PS/2 keyboard hack for a 4 player CP.  I'm fairly certain I have a matrix set up that will work with no ghosting, blocking, or key-limit problems.
Title: Re: USB Keyboard hack question
Post by: Izrun on June 24, 2006, 12:43:21 am
Yeah, I know plugging and unplugging things is not really a big deal.  However, once of my main goals is for my wife or any of my friends to be able (and willing) to swap out components with no knowledge of what to plug in where.  I'm planning on doing some sort of contact usb connection.  Again, I'm still in early planning and am just collecting some components (I figured I would put a message in project announcements once I get a little more focused).  On ebay today I scored a full Spy Hunter control panel for 20 bucks shipped (eBa y Link (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=102250142119&rd=1&sspagename=STRK%3AMEWN%3AIT&rd=1)) and a pair of steel gunner 2 guns for 20 bucks (eBay Link 2 (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=102250187350&rd=1&sspagename=STRK%3AMEWN%3AIT&rd=1)), so I'm pretty excited. 

My other thought is to use a bunch of hacked gamepads.  I would then write an app that would detect which location each unit was plugged in and map them accordingly. 
Title: Re: USB Keyboard hack question
Post by: Izrun on June 24, 2006, 01:13:34 am
Oh, I realized that you were talking about something similar to what I was talking about.   That is similar to what I was thinking.
Title: Re: USB Keyboard hack question
Post by: hanelyp on June 25, 2006, 11:36:02 pm
its not a keyboard hack good / bad question.. .but specifically USB

the trouble with the USB keyboard hacks is the USB keyboard spec specifically says 6 keys.
To be specific, the USB boot keyboard standard (which practically all USB keyboards follow) allows 6 general keys + any combination of shift, control, alt, and 'system' keys.  In the pannel I'm planning, control and shift are being used for 2 of the trigger buttons, pushing the limit to stick + 6 buttons.

Using all control, alt, and shift keys, I could get 12 closed switches at once, at the risk of some software not supporting all the buttons.  Also, the extra 6 would be a 1 keyboard thing.

The more general USB HID standard is far more flexable.  A game encoder intended to be read as a keyboard would have no difficulty with 64 switches.  It just wouldn't work as a 'boot' keyboard.