Re: Welcome to keyboard hell (read on)


[ Follow Ups ] [ Post Followup ] [ Build Your Own Arcade Controls message board ] [ FAQ ]

Posted by EmuMannen on 30, 2000 at 1:36 PM:

In Reply to: Left CTRL key (P1B1) sometimes not recognized by DOS MAME? posted by Rockin' G on 30, 2000 at 8:56 AM:

I haven't noticed what you describe but I am not surprised if it is true. I can’t believe what a mess IBM made out of the keyboard interface for the PC/AT etc. I mean how hard can it be, less than 256 keys and a serial interface… The communication between the on board controller and the keyboard is messy enough but BIOS and DOS is contributing big times to make it even a bigger mess. Codes are intercepted and translated before they reach the interrupt handler and keys must be handles in a quite complicated way (like Print Screen and Pause).

One emulation related issue is the fact that Up/Down/Left/Right-arrows and several other keys generate 100% more traffic and scan codes than most other keys. Another fact is that several keys like Ctrl/Shift/Alt etc. on the keyboard have special functions and is handled by the keyboard, BIOS and DOS in a very special way. The programmer on a low level can treat these keys just like all the other keys but I think that it would be better to use regular keys for user input.

So I think that an emulator really should try to map user input to keys that generate as less traffic as possible (like A..Z etc.) and try to stay away from special keys (like Ctrl/Shift/Alt etc.) if possible. This can all be done (if someone feel a need of really optimise and tweak the keyboard communication between the emulator and the controls) with MAME and a programmable keyboard encoder (or hack). Just remap default keys in MAME and program the keyboard encoder to the best set of keys possible (witch I, by the way, haven’t investigated yet).

Back to your problem. It could be Allegro related. I think that MAME, ArcadeOS and MM all use Allegro as the foundation for their keyboard handling. I also think that Allegro installs its own keyboard handler (I read trough that code once but I don’t really remember the details). The "Left Ctrl key" behaviour could be related to the Allegro keyboard handler but it could also be part of the general IBM keyboard hell design.

/ EmuMannen

: Has anybody else noticed their P1B1 (left CTRL key) not always being recognized in DOS MAME?

: I've specifically noticed it in two places.

: One, at the "press any key to continue" screen that DOS MAME displays (the one with information on which CPUs the board uses, which sound chips, etc.), I always press P1B1 to continue. Frequently, my first press of this key is NOT recognized -- I have to push it again. (There are no other keys "down" at the time, so it isn't some key conflict. I've experienced it with both ArcadeOS and MM [the front end from AdvanceMAME] so I don't think it is related to the front end]. I am using an I-PAC interface, so it isn't because I'm using a home-made keyboard hack. I have tried it on two different motherboards (completely different chipsets) so I don't think it is PC hardware related.

: Second (and the one that bugs my wife the most :-) is when entering high scores in Galaga -- frequently, when pushing P1B1 to enter your first initial, the game will act like you pushed the button TWICE, and enter an "A" as the second letter. I've also seen it where you can enter the first letter and get to the second letter, but when you accept the second letter, it enters an "A" as the third letter for you!

: This is in a cocktail cabinet, and when player 2 gets a high score, this behavior does NOT happen -- you can always enter your initials correctly from the P2 side. Which lead me to believe that it might be something strange related to the fact that it is the CTRL key... but according to the documentation I've found there really isn't anything special about the left CTRL key; it is handled like most of the other keys on the keyboard (unlike Pause/Break and PrtScn, which are special cases, unless a keyboard uses Scancode Set 3 where all keys are single-byte codes?) I've triple-checked the wiring to the P1B1 buttons (there are actually two P1B1 buttons wired in parallel, one on the left and one on the right of the joystick, and both behave the same) so I doubt it's the buttons or their wiring.

: Interestingly enough, I've also experienced this with a keyboard connected to the I-PAC's keyboard pass-thru. I've selected a game, pressed the left CTRL key on the keyboard, and had MAME sit there at the "press any key to continue" screen like I hadn't done anything.

: So... I'm just curious if anybody else has seen this behavior in MAME (DOS version). If not, then I will do more investigating. Otherwise, maybe it is just a known problem? (I checked www.mametesters.com but didn't see anything related to the Galaga high score problem).




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Build Your Own Arcade Controls message board ] [ FAQ ]