BlueMSX 2.4 / 2.5 Keyboard emulation

Page 1/2
| 2

By Anvil

Resident (36)

Anvil's picture

25-07-2006, 12:59

Hello

While writing a game I noticed BlueMSX doesn't report all combinations of pressed keys. When I press up/left/right at once for example, I don't see any key press. Up/left/down only reports up/left. Combinations with the space bar are even worse. This behavior is also annoying when playing games. My real msx allows all combinations of key presses.

Is this a known problem, or is there something wrong with the pc keyboard?

Login or register to post comments

By jltursan

Prophet (2619)

jltursan's picture

25-07-2006, 13:04

Developing "Caverns of Titan" I face the same problem. There're some in-game cheats by pressing several keys, the bigger one using not less than five keys. On the real thing it works flawlessly; but running over emulators it doesn't work; but it's not an emu fault, seems that the PC keyboards aren't able to manage more than three keys at the same time (due its serial data transfer?) Tongue

By Anvil

Resident (36)

Anvil's picture

25-07-2006, 13:12

The pc keyboard interface is capable of reporting many key presses and releases and Windows can handle the same.

But hey, try this on your pc while you're posting a reply: just press up/left/right at once. It doesn't do any my pc! I'd expect the cursor moves somewhere, but nothing happens.

By turbor

Hero (519)

turbor's picture

25-07-2006, 13:50

this has to do with key ghosting and blocking.
If you have a real MSX you can eassilie see ghosting at work when pressing multiple keys at once. This is because the keys on the keyboard are layout in a matrix like way.
Basically, ghosting is a problem with scanning matrix keyboard encoders, where pressing three simultaneous keys that from a rectangle in the (row and column) matrix causes an unintended fourth (ghost) key to register.
This can be overcome by using diodes but isn't done in an MSX

To avoid the problems of ghosting, most newer (1993 and up) keyboards employ a technique called Blocking. Blocking is a firmware method where the keyboard prevents a third input from registering if it forms a rectangle on the matrix and could potentially create a ghost input.
This is ofcourse good for typing, but bad for game emulation. Unlike ghosting, blocking CANNOT be overcome by the use of diodes. Also, blocking is more troublesome than ghosting, because while ghosting creates an unintended input (which may or may not affect your game); blocking prevents an intended input from registering, which is the effect you are experiencing.

It all depends on the keyboard matrix and the controller used in your keyboard, and this can only be overcome by
a) using a joystick
b) creating your own keyboard encoder (or buy an I-PAC http://www.ultimarc.com/ ) and recable your keyboard.

for more info read this pages:
http://www.dribin.org/dave/keyboard/one_html/

and maybe this one
http://www.mameworld.net/emuadvice/keyhack2.html

By mars2000you

Enlighted (6430)

mars2000you's picture

25-07-2006, 16:51

By the way, the keyboards problems are also explained in the blueMSX manual, but no-one seems to read the manual !!!! Tongue

Excerpts from the manual :

Why my keyboard doesn't seem to respond or gets wrong output when I press some keys ?
First thing first, the routine procedure is to check your keyboard configuration on your Windows OS. Be sure that you have a correct keyboard (driver) configuration that matches your locale. This means that you should not use a certain language keyboard that doesn't match your OS language. (i.e. english layout keyboard on japanese OS). Such use can cause unpredictable result when using blueMSX.

Beware that MSX bios chooses which keyboard layout are being used. So if you boot an European MSX machine, then you will have English keyboard layout which matches the MSX keys accordingly. You will most likely to get different output if a Japanese MSX bios is used on an English keyboard. This is how blueMSX is designed and that's a normal behavior.

It can happen that some keyboards have problems with specific keys (like the Kana key on a Japanese keyboard). You can solve this kind of problems by using the Controllers / Keyboard Editor.

Why my keyboard seems to hang when I press many keys at the same time ?
This is not a blueMSX bug, but a problem with some PC keyboards, that act very strange when many keys are pressed at the same time. The maximum keys that can be pressed together can vary from keyboard to keyboard, and this problem can also only happen with some combinations of keys like Right + Left + End or Down + Left + Spacebar.

You can find a solution in most cases by using the keys of the numpad :
- Use the Controllers / Keyboard Editor to change the mapping of the 4 arrows;
- Think as 8,4,6,2 keys as arrows and you should be able to use some combinations that don't work with the arrows.
By using this trick, the above examples become 6+4+End and 2+4+Spacebar.

By turbor

Hero (519)

turbor's picture

25-07-2006, 17:15

Also IIRC if you use a USB keyboard, the USB HID specification states that only 6 keys can be pressed(codes send) simultaneously.

By Huey

Prophet (2694)

Huey's picture

28-05-2008, 22:00

If only i had read this thread 2 days ago CryingCryingCryingCryingCryingCryingCrying
I just wasted my precious time debugging something that isn't a bug CrazyCrazyCrazy

[space]+[left]+[up] just doesnt detect the [space] Tongue

By JohnHassink

Ambassador (5665)

JohnHassink's picture

28-05-2008, 22:43

Hey... I could've told you that... Tongue

By Huey

Prophet (2694)

Huey's picture

28-05-2008, 22:47

So why didn't you? I mentioned it in yesterdays mail.
BA-team

By Manuel

Ascended (19300)

Manuel's picture

28-05-2008, 23:52

Yep, PC keyboards suck. Smile

By Samor

Prophet (2165)

Samor's picture

29-05-2008, 03:06

Most MS keyboards don't have the issue, many Logitech ones do, but the more expensive ones usually have a different key layout and don't (such as the G15, but that might be a bit overkill to some).

A cheaper solution is mapping the arrow keys to the numpad.

Page 1/2
| 2