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: wiring a keyboard  (Read 2845 times)

0 Members and 1 Guest are viewing this topic.

nullb0y

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1307
  • Last login:November 17, 2024, 04:06:05 pm
  • Slow In Fast Out
    • WAT Racing
wiring a keyboard
« on: August 20, 2002, 02:23:06 pm »
ok i plkan to wire my keyboard to some switches ad a joystick but to prevent the dreaded fryiong of my $1,000 pcs mother board what dpo i do to prevent shorting it out?
Slow In Fast Out

neuromancer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 446
  • Last login:May 10, 2006, 04:26:57 pm
  • Can I Play?
Re:wiring a keyboard
« Reply #1 on: August 20, 2002, 02:27:37 pm »
1) read everything you can on the subject, esp all the great tutorials here and on emuadvise on mameworld.net

2) be very careful

3) if possible, find a motherboard worth less than $1000 to test on.

Bob

kgriffin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 65
  • Last login:August 31, 2002, 02:11:24 pm
  • I look nothing like Brad Pitt!
Re:wiring a keyboard
« Reply #2 on: August 20, 2002, 02:36:00 pm »
I just finished my keyboard hack. I had several old keyboards and a few old computers. I chose my least "necessary" computer to use as the "tester".

Let me say that I am not the best solderer in the world. I had wires hanging everywhere and unplugged and plugged the keyboard "hot" several times with several different configurations of buttons depressed.

The worst thing that happened was a constant beeping (like when a key gets stuck).

I used a Dell Optiplex 233 for the test computer and ended up using an APC Keyboard (with a touchpad built in).

I was very impressed by how "forgiving" the computer was to my "bad" shorts. I never fried anything.

If you read everything there is to read and be very careful, IMHO you will be fine.

I will be permanently mounting my control panel this weekend.

Good luck with yours!

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Today at 09:00:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:wiring a keyboard
« Reply #3 on: August 20, 2002, 03:01:08 pm »
Warning! Keyboard hacks are not suitable for any setup that has more than about 3 buttons.

Buy an Ipac, save yourself some trouble.  

kgriffin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 65
  • Last login:August 31, 2002, 02:11:24 pm
  • I look nothing like Brad Pitt!
Re:wiring a keyboard
« Reply #4 on: August 20, 2002, 03:21:01 pm »
hmmm....I have had at least 20 different people tell me not to hack a keyboard since I started posting.

I almost ordered an IPAC a couple of weeks ago when I started my project, but they were on vacation.

Thanks to Tiger-Heli and a bunch of spare parts, I decided to try a hack instead.

It took about 2 hours to map out my matrix and to achieve 16 simultaneous key presses (using scotch tape and my wifes hands).

I have 2 8-way joysticks and 8 player buttons...thats 1 joystick and 4 buttons per player. (If I played streetfighter games I would have wired up 2 more per player - I have them available) but I don't need them. Not to mention the non-player buttons (esc, tab, F3, etc...)

I don't want to buy an IPAC. I don't need to buy an IPAC.
I am glad that everyone loves them, and I may get one for my next project. But until then, my keyboard hack works better than anyone who hasn't done it can seem to comprehend and it cost me $1.99 (heat shrink).

With the right keyboard and some time, you can have as many buttons as you will ever need.

If hacking a keyboard sounds fun to you, or you think you will like the sense of accomplishment or you have some old keyboards laying around and don't have an extra $40. then by all means HACK AWAY!

Just be careful, study all the posts and look the other way when someone tells you the sky is falling if you hack a keyboard.

My 2 cents

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
Re:wiring a keyboard
« Reply #5 on: August 20, 2002, 04:45:18 pm »
WARNING:  Don't take Howards statements seriously.

but listen to me... because I know WAY more then howard does!   ;)

The truth... Hacking a keyboard sucks... takes a long time... isnt' always reporducable since keyboards are netorious for having different encoders for the same exact keyboard make and model... and well... you can't get that many buttons (20 is about the most I've heard of).

I hacked a keyboard... didn't like it... Spent a LONG time doing it.

I hacked a joystick.... MUCH BETTER.  No ghosting or matrix since they are expected to have all the buttons pressed... but you don't get that many buttons (15 on the one I did).

then I bought an encoder (mk64) and wish I didn't spend the time and effort on the other hacks.  

They are cleaner... easier to configure... handle WAY more buttons... more compatible (for the joystick option anyway)...

ie, you wont' feel like you've gone wrong with an encoder... I have NEVER HEARD one person say... man I wish I had only hacked a keyboard or a joystick... I hate my encoder.  

I've heard that about EVERY other part of the hack jobs... I wish I had built my own instead of using an original... I wish I had used a TV/CRT/SVGA (heard them all).  I've heard about people wishing they had hacked a USB mouse instead of a PS2 mouse...

but if you want to hack something... look into a joystick (especially a USB one that you can hotswap and add more later)

good luck

nullb0y

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1307
  • Last login:November 17, 2024, 04:06:05 pm
  • Slow In Fast Out
    • WAT Racing
Re:wiring a keyboard
« Reply #6 on: August 20, 2002, 06:23:52 pm »
for now im going to wire up a joystick because it seems easier for a 1 player control box and it will be alot smaller but later im going to make a 2player control syetem and i refuse to spend more then 5$ on anything i do lol so im gonna hack a keyboard not an ipac lol ill add a link to a page with pictures of my joystick and where im going with it on this site i think or just link from the message board lol my pc is to precious so ill hack a joystick as long as i keep the soder on the right sapot i wont blow out my $1,000 computer heh (i dont have a test machine with a gameport)
Slow In Fast Out

sirhcman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 36
  • Last login:January 20, 2008, 01:50:45 pm
  • I'm a llama!
Re:wiring a keyboard
« Reply #7 on: August 20, 2002, 08:50:57 pm »
You could sell your thousand dollar motherboard and buy a much cheaper one, an ipac, and have plenty of money left over  ;D

nullb0y

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1307
  • Last login:November 17, 2024, 04:06:05 pm
  • Slow In Fast Out
    • WAT Racing
Re:wiring a keyboard
« Reply #8 on: August 20, 2002, 09:55:35 pm »
it cost that much nopt worth that much lol the pc was really expencive the mother board is probally a couple hundred but i dont got that kinda cash anyways heh
Slow In Fast Out

Sasquatch!

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1138
  • Last login:March 01, 2010, 04:11:47 pm
  • Toot-Toot!
    • Arcade Paradise
Re:wiring a keyboard
« Reply #9 on: August 20, 2002, 10:29:58 pm »
I'll have to chime in on the "buy an encoder" bandwagon here.  I may be a bit biased though, since I did fry out a motherboard doing a keyboard hack.

A keyboard hack is certainly less expensive than an encoder, but if AT ALL POSSIBLE, save up and buy one.  The IPAC isn't that expensive.

neuromancer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 446
  • Last login:May 10, 2006, 04:26:57 pm
  • Can I Play?
Re:wiring a keyboard
« Reply #10 on: August 21, 2002, 10:38:00 am »

Warning! Keyboard hacks are not suitable for any setup that has more than about 3 buttons.

Buy an Ipac, save yourself some trouble.  


That first sentence should have the words "unless you know what you're doing" tacked onto the end. I've hacked a number of keyboards. It takes a couple hours, but you usually get 16 inputs which is perfect for 2 joysticks with 6 buttons each.

otoh, if you don't take the time to decode the matrix and just hook buttons willy-nilly to the deocder, you will hate the results for sure.

Due to domestic relations, my arcade budget is very slim. I'd rather take the hour or two and not spend the money on the ipac.

I found some instructions on how to hook up joysticks with resistors to plug into a joyport. That one sucks. I would have been much better off hacking another keyboard!

Bob





kgriffin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 65
  • Last login:August 31, 2002, 02:11:24 pm
  • I look nothing like Brad Pitt!
Re:wiring a keyboard
« Reply #11 on: August 21, 2002, 01:26:23 pm »
Here, here!!! Another keyboard hacker. I thought I was the only one left.

nullb0y

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1307
  • Last login:November 17, 2024, 04:06:05 pm
  • Slow In Fast Out
    • WAT Racing
Re:wiring a keyboard
« Reply #12 on: August 21, 2002, 01:48:35 pm »
is it true if you use diodes in series with your switches it will prevent ghosting?
Slow In Fast Out

neuromancer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 446
  • Last login:May 10, 2006, 04:26:57 pm
  • Can I Play?
Re:wiring a keyboard
« Reply #13 on: August 21, 2002, 03:08:07 pm »

is it true if you use diodes in series with your switches it will prevent ghosting?


They quit making keyboards with ghosting a long, long time ago. 1989 is the oldest I have, and that early they had eliminated ghosting.

I have yet to see a diagram that demonstrated how diodes could possibly make any difference in a keyboard hack.

I think the diodes thing is an "urban legend"

Bob


chanson

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 22
  • Last login:August 21, 2003, 01:09:57 pm
  • Finished 1 MAME machine, working on #2!
Re:wiring a keyboard
« Reply #14 on: August 21, 2002, 11:20:32 pm »
I hacked a keyboard for my first MAME machine.  I am very pleased with the results.  I had to tear up 2 keyboards and probably spent about 4-5 hours total (including reading on the internet about it, etc.)

Next time I'll likely buy an IPac.  There are a few features that I want that you don't get with a kbd hack.

1 - Keyboard passthrough.  Sure you could get or make a splitter, but that costs money

2 - Shift Keys  Hopefully to clear the control panel of the "special" keys needed to configure MAME

It's a good experience hacking a keyboard if you're really into the electronics of this hobby.  But I'll likely join the I-Pac crowd for my next two machines (actually I have 2 in the pipeworks!)


innkeeper

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:June 22, 2005, 10:46:31 pm
  • I want my own arcade controls!
Re:wiring a keyboard
« Reply #15 on: February 14, 2003, 01:57:40 pm »
Some truths about keyboard hacks

I know this is an old thread, but i just had to reply to a few things i read with some facts.

first, somone commented that new keyboards do not have ghosting and diodes are an 'urban legend'.

well being an engineer, I can say that it is an electrical imposibility to avoid ghosting and masking in a keyboard matrix (or any matrix) unless you use diodes. the use of diodes in a matrix to prevent ghosting and masking is common practice. FYI, the typical doide used is a 1N4148 which are also VERY cheap.

Around 1989 keyboard manufacturers changed to controller code to ignore keypresses combinations that would cause a ghost charaters.
This does change things when hacking a keyboard. Some keyboards will block listening for a keypress (switch closing) that would otherwise cause a mask or ghost condition until the key combination being pressed allows for that key to be used without a ghost condition.  on the other hand, if they do not check for this condition the diode works very well. ghosting and masking is still there without diodes. but with diodes it allows for all keys to be registered without masking or ghosting.

so the limitations of how far you can go (number of sumultaniously usable keys) with your keyboard hack is a mater of the keyboard controllers coding.

Thje bottom line on diode use. if you have an old keyboard where you can actualy press keys and create a ghost character, then use diodes and you can extend the number of simultanious inputs you can get without ghosting (up to the number of keys you have on the keyboard).

if your keyboard shows no ghosting, but keys are masked when hitting multiple keys, then the controlers code is stoping the possibiltiy of a ghost situation. if you can avoid all of those combinations then you dont need diodes, but if you have some you want to use for non player keys (i.e coin, player1 etc..) you should still use them to prevent a possible masking situation.


Anther comment made, 'keyboard hacks are not sutable for more than 3 buttons.'

Again not true. Lets take a closer look. A typical keyboard has over 100 buttons, each can be isolated and used sumultaniously as long as there is a diode inline with each switch. (less with newer keyboards see above)

As far as speed goes, keyboards are fast.
how fast is fast....
All key in a keyboard are checked every 10 milliseconds. Any device you use (keyboard interface or not),  has to debounce the switch closing for around 20 milliseconds before it is sent to your computer, this makes a keyboard as fast as any other device since they all will wait to debounce the switch closing before considering a switch closed.

Tech Note: 20ms works nicely into 2 pollings (key checks) of the key in a keyboard interface. After the key is debounced it is placed in the keyboards output buffer to go to the pc (yes keyboards have output buffers built in, not that you can hit keys/buttons  fast enough for it to make a diffrence)

Each key in the matrix handle around 50 transitions a second (a transition is either closing or opening a switch) most keyboards can handle over with over 100 inputs giving the ability to handle 5000 key (switch) transitions in a second.

Tech Note: (how i got the 5000 transitions number) figure 20ms to debounce a key transition. 1000ms/ 20ms = 50 key transitions maximum  per second times 100 keys = 5000 transitions.

One last note for those of you who still think keyboard interfaces might be slow, I would like to meet the person who can press a single button 25 times a second!!! (25 presses+25 depresses=50 transitions per key or switch)

There are folks out there using 49 way joysticks on a keyboard interface.

now thats interfacing!

There are pleanty of legitimate reasons not do do a keyboard hack. It takes time to map out the keys, check to see what can and cannot be used together as not many keyboards are the same.

I would agree that keyboard hacking is not for the faint of heart. but you can't beet the price and it is alot of fun.

I hope this helps with any mis information.

PLEASE PLEASE PLESE, if you wish to add more facts or correct any facts I have here please do. It would be great to see more information based on facts not  guess work on this very inexpensive and versital type of interfacing.

Personaly i would love to hear of others matrix tricks, I am hoping i can get the time to post some of mine.

If I have time, i'll do a full writeup on keyboard masking, ghosting, debouncing explination, performance, diode use, and some very neet tricks you can pull with a matrix you cant otherwise do with a non-matrix input device.

If you want to try using diodes, the diode i use is a 1N4148
diodes only let the keyboard polling singnal go one way.
so, if you put it in the wrong way, the switch will not function. if that happens just turn the diode around. (they are marked with a band on one side)
unless you are doing somthing fancy, you will need to put the diodes on each of you switches connected to the keyboard interface.

Antoher peice of advice is to not let the diode get very hot if you solder to it. otherwise it might be damaged, (if you suspect you damaged one, just use a multi-meters ohm meter to check it. one way should give a very low resistance reading, and swaping the leads the other way it sould give a high resistance reading)

Disclaimer: as always use this information at your own risk.


Happy Interfacing

Innkeeper





 

« Last Edit: March 12, 2003, 09:47:31 pm by innkeeper »

hyiu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1481
  • Last login:August 29, 2014, 05:36:15 am
  • too many games... too little time....
    • www
Re:wiring a keyboard
« Reply #16 on: February 14, 2003, 02:48:03 pm »
Warning! Keyboard hacks are not suitable for any setup that has more than about 3 buttons.

Buy an Ipac, save yourself some trouble.  

haaa haaa haaa.... Howard has been very pushy and hard sell on IPAC recently.... maybe he's getting kick backs from the Ultimarc's site.....
haaa haaa haaa....
 ;) ;D

Another Brilliant mind ruined by education....  :p