Build Your Own Arcade Controls Forum

Main => Main Forum => Topic started by: soulblazer28 on December 30, 2005, 01:14:34 am

Title: keyboard hack / encoder question
Post by: soulblazer28 on December 30, 2005, 01:14:34 am
Hello all,

Well I am the newest retro dreamer to start planning on building a MAME cabinet from scratch -- despite no woodworking skills or wiring skills.  I've seen and read enough to be somewhat confident enough to at least get myself into trouble.

Anyway, I've been a long time programmer and perhaps I have a naive question. Being new to the ideas of hacking a keyboard or keyboard encoders, I am left a bit confused about one thing. Keyboards have limits on the number of keys that can be pressed simultaneously, yet it seems that there is no such limit with keyboard hacks or encoders -- at least not that I could find on the forum search.  As much as I'd liike to know how the limitation disappears (perhaps its not a hardware issue but a bios issue, etc) but ultimately I just want to rest in peace that one could press every button and joystick on the cabinet simultaneously and have all of them register.

I'd be grateful if anyone could enlighten me. Thanks! :)

Title: Re: keyboard hack / encoder question
Post by: Kremmit on December 30, 2005, 01:24:14 am
Keyboards suffer from Ghosting and Blocking.  Blocking is when some of your keypresses get missed, and Ghosting is when you get extra keypresses even though you didn't press those keys. 

Keyboard hacks suffer from these problems exactly the same way that regular keyboards do.   There are ways to prevent some of it and work around some of it.  If you really care, take a look at the website that is the companion to these message forums- www.byoac.com will get you there.  There's lots of info about keyboard hacks there.

But the short version is, it's a lot easier and not much more expensive (if at all) to just buy a keyboard encoder.  Decent encoders have the Ghosting and Blocking problems ironed out already, so you don't have to sweat it.
Title: Re: keyboard hack / encoder question
Post by: missioncontrol on December 30, 2005, 03:41:28 am
one warning about keyboard hacks... test it on an old pc that you don't care about....

I fried my test computer with one
Title: Re: keyboard hack / encoder question
Post by: Thenasty on December 30, 2005, 05:39:54 am
save yourself the TIME and HEADACHES, buy an ENCODER ASAP . . . . . . ;)
Title: Re: keyboard hack / encoder question
Post by: Lilwolf on December 30, 2005, 10:27:15 am
I hacked a keyboard... then I hacked a joystick (better but less keys.. made for gaming)... then I bought an encoder.  Best money I've spent on my arcade.

But now thta you can get an encoder for 21 bucks (keywiz eco + ide standoffs) its super easy and cheap.  There is no reason to hack a keyboard right now...

Heck, I bought one for my jukebox where I never had to deal with any of those problems... just because the 20 bucks was worth it in easier wiring!

There are other 20 buck items you can probably get away without... but encoder shouldn't be the place to scrimp.  I would rather have a computer 1/3 the speed instead myself.
Title: Re: keyboard hack / encoder question
Post by: neuromancer on January 03, 2006, 04:21:02 pm
I've had good success hacking IBM PS/2 keyboards.

There are exactly enough input lines on most non-usb keyboards to enable 2 joysticks with 6 buttons each. They key's that are used to make a bunctional hack end up being bizzarre, like scrl lock, F8, \ and the like.

It took me about 2 hours to decode the input matrix on the keyboard. Upon playing it, we found that I had used certain keys that do a windows function, like the alt key and the enter key, that would dump one out of most emulators.

There is a tutorial on mameworld.net that will tell you everything you need to know about how to hack a keyboard, including decoded matrixes for several keyboards.

I hacked a Saitek gamepad too, which seems to work well enough.

If you're spending money on a cabinet anyway, and don't mind spending more, then go for the encoder, because they sound so much easier. If you're scrounging for spare parts and want to build on the most restrictive budget, then a keyboard hack will serve you just fine, provided you don't need more than 2 sticks with 6 buttons each.

Bob
Title: Re: keyboard hack / encoder question
Post by: markb on January 03, 2006, 05:50:48 pm
Firstly welcome to the boards Soublazer, always good to have someone with a bit of programming knowledge 'sign up'

I will second pretty much what everyone else has said having gone down the joystick-keyboard-encoder route myself. Unless you are on an extremely tight budget I would go for the encoder straight off, hacking a joystick or keyboard can be a challenge however the effort & drawbacks now outweigh the cost of an encoder.

I would however read up about what encoder to buy as there are some good choices out there
Title: Re: keyboard hack / encoder question
Post by: Tiger-Heli on January 04, 2006, 08:08:20 am
Okay - first off, I wrote the aforementioned piece on keyboard hacking - you can find it here -
http://www.mameworld.net/emuadvice/keyhack2.html

I also wrote a lengthy comparison of keyboard encoders here:
http://www.mameworld.net/tigerheli/encoder/index.htm

Master link to all pages Tiger-Heli:
http://www.mameworld.net/tigerheli/

Short summary - You will save yourself time and money buying a keyboard encoder first off and forgetting about a keyboard hack.

Yes, you probably can make a keyboard hack work for two-player fighters, but there are ghosting and blocking issues to work around (and they can be overcome).
Title: Re: keyboard hack / encoder question
Post by: soulblazer28 on January 04, 2006, 11:50:53 pm
Thanks for all the great responses -- more than I anticipated.  I'm really at a point of considering everything and just wanted to clear up the confusion about "blocking."

One of my goals is to make a dedicated Defender/Stargate CP (my all-time favs), which means I'd have to make removable panels, which I originally thought I could use cheap keyboard hacks for each board, but have been wised up on using one encoder and RJ45 connectors.

Thanks for the welcome as well. I have ten years programming experience in everything from games to databases.  I'm toying with the idea of creating a Mame / Jukebox combo front-end sometime this year -- if I dont get busy  ;D
Title: Re: keyboard hack / encoder question
Post by: soulblazer28 on January 17, 2006, 01:59:17 am
After doing some planning and research I find myself with a dilemma

I am planning on a control panel that has two players, each having dual joysticks and six buttons.  By my count that is 16 inputs for the joysticks, and 12 inputs for the buttons, plus 4 buttons for 1&2 player coin and start. That is a total of 32 inputs. Oh no! What about administrative buttons?

The dual joysticks will be used for games such as smash tv, total carnage, and robotron. These are all games where most of the buttons will not be used. I suppose I can map four inputs per player to both the buttons and the left joystick.  However, I am weary of doing this if I can avoid it.

Does anyone know of any other sensible solution without having to buy two 32 input encoders, or a single encoder with more inputs?  I don't suppose its feasible to have one of the action keys as a shift key, or is the shift key a separate entity?  If that were the case, I think I'd be set.
Title: Re: keyboard hack / encoder question
Post by: aumameman on January 17, 2006, 02:33:58 am
Maybe your answer is the ipac from www.ultimarc.com (http://www.ultimarc.com) as it has shift key function build in. Example player 1 and player 2 button hit together will cause "esc" key. Basically the player 1 button is a sift button aswell as its usual player 1 start.
Title: Re: keyboard hack / encoder question
Post by: Tiger-Heli on January 17, 2006, 07:49:38 am
Maybe your answer is the ipac from www.ultimarc.com (http://www.ultimarc.com) as it has shift key function build in. Example player 1 and player 2 button hit together will cause "esc" key. Basically the player 1 button is a sift button aswell as its usual player 1 start.
Player 1 and Player 2 Start together = Escape is a good reason NOT to get the I-PAC, but you could always set the shift key to a different input and avoid this problem.
I am planning on a control panel that has two players, each having dual joysticks and six buttons.  By my count that is 16 inputs for the joysticks, and 12 inputs for the buttons, plus 4 buttons for 1&2 player coin and start. That is a total of 32 inputs. Oh no! What about administrative buttons?

Does anyone know of any other sensible solution without having to buy two 32 input encoders, or a single encoder with more inputs?  I don't suppose its feasible to have one of the action keys as a shift key, or is the shift key a separate entity?  If that were the case, I think I'd be set.
I think your best bet would be the KeyWiz from GroovyGameGear.  It has a separate shift key (not combined with one of the 32-inputs), plus you can wire a button so it activates a shift function automatically.

You do not want the action key as a shift key or as a shifted input, but coin, start, etc. as a shift key is fine.  For the panel you describe, you are looking at 28 action keys.  I would have Pause and maybe Escape as "hard" inputs, along with coin 1 and coin 2, and map the P1 and P2 Start keys to stealth-shifted inputs.

In this thread (http://forum.arcadecontrols.com/index.php/topic,21870.msg177190.html#msg177190), I explain how to wire up a 4-player panel using the KeyWiz.  You would be doing something similar, but could avoid all shared inputs.

See http://www.mameworld.net/tigerheli/encoder/shiftkeys.htm for a discussion of stealth-shifted inputs, and http://www.mameworld.net/tigerheli/encoder/startkey.htm for a discussion about getting rid of the start keys to save more inputs (although you wouldn't need to do this).
Title: Re: keyboard hack / encoder question
Post by: rwhip41 on January 19, 2006, 12:57:53 am
Regarding the ipac and the Shift function...

You could run a junctionfrom the Player 1 and Player 2 buttons to a seperate button that serves as the Escape function.

EDIT: I have an ipac and like it a lot, but a motivation to go with a Keywiz are for the 2-player games with a Continue option (more coins in). We've accidently ended many a game when both players hit their Player start buttons at the same time. Otherwise, the ipac works great for shift functions via easy extra button hookups.
Title: Re: keyboard hack / encoder question
Post by: Tiger-Heli on January 19, 2006, 07:35:32 am
Regarding the ipac and the Shift function...

You could run a junctionfrom the Player 1 and Player 2 buttons to a seperate button that serves as the Escape function.

EDIT: I have an ipac and like it a lot, but a motivation to go with a Keywiz are for the 2-player games with a Continue option (more coins in). We've accidently ended many a game when both players hit their Player start buttons at the same time. Otherwise, the ipac works great for shift functions via easy extra button hookups.
Exactly . . .

The problem Soulblazer has is that he is using 28 ACTION keys so there is no good way to make the shift function work (short of maybe combining P1 and P2 buttons 3 through 6 with the P1 and P2 second joystick inputs, which frees up 8 inputs - i.e., there are ways to work around it and make it work but they are awkward).

In general, regarding the P1 and P2 = Escape problem - I am a big fan of a dedicated Pause Key - so if you remap P2 B8 to "P", leaving 27 other inputs, you then can set P2B8 as the Shift key, so pressing Pause and 1P Start at the same time = Escape, etc.   This is MUCH less likely to be accidentally activated.

BTW - Soulblazer - Another option to consider would be the I-PAC VE which has 32 inputs and is USB.  It can also use Stealth-shifted keys, but the wiring is more complicated.