You posted more info in the E-mail you sent me, so I'll repeat that here for others:
i have an upright pac-man and wanted to do some testing with mames save state, etc, for practice. i also have an extra control panel and some original joysticks so i thought an easy way to play with an original joystick would be with a keyboard hack. i created it with an original wico leaf switch joystick (used for pac-man replacement) and a 1990 keyboard with a heavy easily soldered pcb. when i play mame with the joystick one direction will eventually (1 to 3 minutes) end up not responding. for example if i take sharp turns up, left, then down, the pac will not go up.
when i flip to mame using tab the screen is scrolling down because the down arrow is stuck but none of the switches are touching. the joystick switches are wired to the directionals. i was thinking about getting an i-pac or something but this is really bugging me and i dont want to buy an i-pac then find out the original pac-man joysticks need to be modified. when i play and dont cut the corners tight and let the joystick center after every turn or just take 4 way movement instead of turning into the next direction everything works fine but its impossible to play well like that.
so could this be ghosting, old keyboard, joystick, bad choice with the direction keys, or something else?
strange thing is i can never get it to happen with directional keys on a keyboard w/o the hack although i havent tried it with a really old keyboard like the one i used for the joystick hack.
Question - is the game always stuck with the screen scrolling down? Or is it sometimes stuck scrolling up or left or right instead? (Doesn't really tell me much, but I'm curious).
Okay - now let's look at what your problems could be.
It it not ghosting - (will surprise a lot of people) - ghosting/blocking occurs when three keys are pressed at the same time. Pac-Man will at most activate two.
Likely is not choice of keys. The directionals are a poor choice, and would make for sluggish response, but not okay play for 1 or 3 minutes and then a supposed stuck key.
It really sounds like the joystick is somehow overflowing the keyboard buffer and creating the apparent stuck key.
Ideas -
Check for key-repeat settings in Windows and disable them (although MAME usually ignores these).
Check you wiring for bad soldering or any possibility of wires creating a stuck key even if the joystick is not stuck. Check the operation of the joystick leaf switches.
Is there an analog joystick (gameport, USB) connected to the computer - if so disable it in MAME - sometimes these can get stuck out of calibration (down) and fight for control with MAME.
All I can think of so far -
Oh - like Rescue 161 said, fire up Ghostkey or similar and see what happens when you use the joystick and whether any keys get stuck in that. Also just test it out in notepad also. . .
HTH.