Max number of simultaneous keypresses

Hello everybody,

I have often encountered a problem in various games : when about 3 keyboard
keys are keeped pressed, it is impossible to press more keys (the presses
are ignored). I was wondering where this problem come from (hardware
limitation ?), and if there could be a means to work around it with SDL. It
can be used to cheat in games in which several people play on the same
keyboard (frozen-bubble, jumpnbump… :wink: and I’d like to prevent that.

Thanks in advance,

Nicolas

Le Thu, 24 Feb 2005 22:14:48 +0100
blurgk a ?crit:

I have often encountered a problem in various games : when about 3
keyboard keys are keeped pressed, it is impossible to press more keys
(the presses are ignored). I was wondering where this problem come
from (hardware limitation ?), and if there could be a means to work
around it with SDL. It can be used to cheat in games in which several
people play on the same keyboard (frozen-bubble, jumpnbump… :wink: and
I’d like to prevent that.

It is mainly a hardware problem. Keyboards are wired like a big array,
and pressing a key gives a row and a column (approximately). So if you
press more than 2-3 keys, you have many more connections done, and the
hardware don’t send all the keys pressed.

Solution: Use a joystick! This is what they are for. And SDL support
both analog and digital joysticks. Only force feedback (and maybe rumble
?) is missing.–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

i always liked this page for explaining the issue:

http://www.sjbaker.org/steve/omniv/keyboards_are_evil.html> ----- Original Message -----

From: mandin.patrice@wanadoo.fr (Patrice Mandin)
To: "A list for developers using the SDL library. (includes SDL-announce)"

Sent: Thursday, February 24, 2005 1:26 PM
Subject: Re: [SDL] Max number of simultaneous keypresses

Le Thu, 24 Feb 2005 22:14:48 +0100
blurgk a ?crit:

I have often encountered a problem in various games : when about 3
keyboard keys are keeped pressed, it is impossible to press more keys
(the presses are ignored). I was wondering where this problem come
from (hardware limitation ?), and if there could be a means to work
around it with SDL. It can be used to cheat in games in which several
people play on the same keyboard (frozen-bubble, jumpnbump… :wink: and
I’d like to prevent that.

It is mainly a hardware problem. Keyboards are wired like a big array,
and pressing a key gives a row and a column (approximately). So if you
press more than 2-3 keys, you have many more connections done, and the
hardware don’t send all the keys pressed.

Solution: Use a joystick! This is what they are for. And SDL support
both analog and digital joysticks. Only force feedback (and maybe rumble
?) is missing.


Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

i once used a different approach; not sure how it would work in SDL
though… in a two player game every second iteration of my main loop
checked different keys to see if they were being pressed. game assumed
the other player was still pressing the keys last iteration. i’m not
sure if this fits into SDL’s event style of doing itOn Thu, 24 Feb 2005 13:34:50 -0800, Alan Wolfe wrote:

i always liked this page for explaining the issue:

http://www.sjbaker.org/steve/omniv/keyboards_are_evil.html

----- Original Message -----
From: “Patrice Mandin” <mandin.patrice at wanadoo.fr>
To: "A list for developers using the SDL library. (includes SDL-announce)"

Sent: Thursday, February 24, 2005 1:26 PM
Subject: Re: [SDL] Max number of simultaneous keypresses

Le Thu, 24 Feb 2005 22:14:48 +0100
blurgk a ?crit:

I have often encountered a problem in various games : when about 3
keyboard keys are keeped pressed, it is impossible to press more keys
(the presses are ignored). I was wondering where this problem come
from (hardware limitation ?), and if there could be a means to work
around it with SDL. It can be used to cheat in games in which several
people play on the same keyboard (frozen-bubble, jumpnbump… :wink: and
I’d like to prevent that.

It is mainly a hardware problem. Keyboards are wired like a big array,
and pressing a key gives a row and a column (approximately). So if you
press more than 2-3 keys, you have many more connections done, and the
hardware don’t send all the keys pressed.

Solution: Use a joystick! This is what they are for. And SDL support
both analog and digital joysticks. Only force feedback (and maybe rumble
?) is missing.


Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Unless you’re dealing with an API that’s broken in some mysterious way
I can’t even imagine, this doesn’t help - not even if you could do it
on the matrix scanning level in the keyboard. You need diodes in the
switch matrix to be able to tell ghosts from real keys, no matter how
the scanning is done - and no PC keyboard I’ve seen so far has any
diodes.

To make things even worse, keyboards deal with ghost keys differently.
Some very cheap and simple ones just ignore the problem and throw any
"detected" keys, including ghosts, at the PC. Others try to hide the
problem by filtering out some or all potential ghosts in combinations
that are known to produce ghosts.

So, even if you knew exactly what the keyboard at hand is doing, you
wouldn’t be able to do much, because most keyboards throw information
away. If you don’t even know how the keyboard hardware handles
ghosts, I don’t think there’s anything useful that can be done.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Monday 28 February 2005 14.40, Brian Barrett wrote:

i once used a different approach; not sure how it would work in SDL
though… in a two player game every second iteration of my main
loop checked different keys to see if they were being pressed. game
assumed the other player was still pressing the keys last iteration.
i’m not sure if this fits into SDL’s event style of doing it