Keyboards Stink

Hey,

Has anyone out there come up with a good way to deal with simultaneous key
presses? If many keys are pressed, some do not report a KEYUP event. This
appears in an app as if the button is stuck in the down position.
Currently, I keep track of the key states, but is there a way around this
limitation? Maybe cancelling all key presses if too many are down?

Jonny D

Jonathan Dearborn wrote:

Has anyone out there come up with a good way to deal with simultaneous
key presses? If many keys are pressed, some do not report a KEYUP
event. This appears in an app as if the button is stuck in the down
position. Currently, I keep track of the key states, but is there a way
around this limitation? Maybe cancelling all key presses if too many
are down?

Google n-key rollover–
khman
KL, MY

Thanks, that helps me with my terminology.

So, does anyone know of a good approach to deal with key jamming (aside from
a new keyboard)?

Jonny DOn Fri, Jan 23, 2009 at 12:43 PM, KHMan wrote:

Jonathan Dearborn wrote:

Has anyone out there come up with a good way to deal with simultaneous key
presses? If many keys are pressed, some do not report a KEYUP event. This
appears in an app as if the button is stuck in the down position.
Currently, I keep track of the key states, but is there a way around this
limitation? Maybe cancelling all key presses if too many are down?

Google n-key rollover


khman
KL, MY


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

Allow binding stuff to joysticks. Unless your project isn’t suitable at
all for using joysticks as input.

Edgar

Jonathan Dearborn wrote:

Thanks, that helps me with my terminology.

So, does anyone know of a good approach to deal with key jamming (aside from
a new keyboard)?

Jonny D

Jonathan Dearborn wrote:

Has anyone out there come up with a good way to deal with simultaneous key
presses? If many keys are pressed, some do not report a KEYUP event. This
appears in an app as if the button is stuck in the down position.
Currently, I keep track of the key states, but is there a way around this
limitation? Maybe cancelling all key presses if too many are down?

Google n-key rollover


khman
KL, MY


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org



SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkl6Ct4ACgkQolm4VNX3QTx8/wCeJqzSXOKjAnTw3iRxADpSMjh2
aTAAoIFOpJN8TnuLZFVPJmyutcpibWci
=7tF7
-----END PGP SIGNATURE-----> On Fri, Jan 23, 2009 at 12:43 PM, KHMan wrote:

Thanks, that helps me with my terminology.

So, does anyone know of a good approach to deal with key jamming (aside from
a new keyboard)?

Well, good lightly used keyboards are available in second hand stores…

Seriously, you need to get a working keyboard.

Keyboards suck and there doesn’t seem to be anything we can do about
it. The hardware of a keyboard is designed for typing, not for being
used for creating arbitrary chords or arbitrary keys.

Bob PendletonOn Fri, Jan 23, 2009 at 12:18 PM, Jonathan Dearborn wrote:

Jonny D

On Fri, Jan 23, 2009 at 12:43 PM, KHMan wrote:

Jonathan Dearborn wrote:

Has anyone out there come up with a good way to deal with simultaneous
key presses? If many keys are pressed, some do not report a KEYUP event.
This appears in an app as if the button is stuck in the down position.
Currently, I keep track of the key states, but is there a way around this
limitation? Maybe cancelling all key presses if too many are down?

Google n-key rollover


khman
KL, MY


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

±-------------------------------------+

Keyboards suck and there doesn’t seem to be anything we can do about
it. The hardware of a keyboard is designed for typing, not for being
used for creating arbitrary chords or arbitrary keys.

You could rewire an existing keyboard and throw in your own microcontroller ;)On Fri, Jan 23, 2009 at 2:18 PM, Bob Pendleton wrote:

On Fri, Jan 23, 2009 at 12:22 PM, Jonathan Dearborn wrote:

Has anyone out there come up with a good way to deal with simultaneous key
presses? If many keys are pressed, some do not report a KEYUP event. This
appears in an app as if the button is stuck in the down position.

They do eventually report a KEYUP event, right? You’re not saying
the key appears to be stuck indefinitely? That would be a different
problem. Just checking to make sure!


http://codebad.com/

Indefinitely without user interaction, yes. You have to press and release
the offending key to stop the cursor from moving (or ship from spinning,
etc.). The best I’ve got right now is that you can press the opposite
direction to stop it as well (the natural reaction to a runaway cursor).

Jonny DOn Fri, Jan 23, 2009 at 4:16 PM, Donny Viszneki <donny.viszneki at gmail.com>wrote:

On Fri, Jan 23, 2009 at 2:18 PM, Bob Pendleton wrote:

Keyboards suck and there doesn’t seem to be anything we can do about
it. The hardware of a keyboard is designed for typing, not for being
used for creating arbitrary chords or arbitrary keys.

You could rewire an existing keyboard and throw in your own microcontroller
:wink:

On Fri, Jan 23, 2009 at 12:22 PM, Jonathan Dearborn <@Jonathan_Dearborn> wrote:

Has anyone out there come up with a good way to deal with simultaneous
key
presses? If many keys are pressed, some do not report a KEYUP event.
This
appears in an app as if the button is stuck in the down position.

They do eventually report a KEYUP event, right? You’re not saying
the key appears to be stuck indefinitely? That would be a different
problem. Just checking to make sure!


http://codebad.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

That’s a very different problem from any keyjamming problem I’ve ever
experienced. Just to be clear:

Depress Q
Depress W
Depress S
Release S
Release W
Release Q

Keyjamming problem: No events for S are ever sent.

This is a common problem, and this is the reason that so many games
use the modifier keys as buttons: because modifier keys are intended
for use in combination with other keys, they often get their own
circuits, which means they can be combined with more combinations of
keys.

I’ve never encountered a keyboard would send a KEYDOWN event for a
key, and then not send a KEYUP event even whenever all keys have
been released. You have a seriously shitty keyboard if that is the
case. Buy a new one! (Or, as I said earlier, replace the keyboard
controller!)On Fri, Jan 23, 2009 at 5:45 PM, Jonathan Dearborn wrote:

Indefinitely without user interaction, yes. You have to press and release
the offending key to stop the cursor from moving (or ship from spinning,
etc.). The best I’ve got right now is that you can press the opposite
direction to stop it as well (the natural reaction to a runaway cursor).


http://codebad.com/

Hee hee, I don’t really want to replace my MacBook’s keyboard! Here’s a
usage case that does it for me:
Press Right arrow
Press Up arrow
Press Down arrow
Release Right arrow (This is the problem event)
Release Whatever

I know that all keyboards are different, so you can probably only reproduce
this with an older MacBook, but there should be an equivalent series for
everyone without a keyboard capable of n-key rollover. I’m going to give up
for now and move on. There’s lots more to do!

So, without giving too much away, I’m working on a GUI lib that (among other
things) abstracts the input, allowing for mouse, keyboard, and joystick to
act like a mouse (a la Maniac Mansion, for example) or for keyboard and
joystick to navigate between widgets (like nearly every console game’s GUI).

Jonny DOn Fri, Jan 23, 2009 at 5:52 PM, Donny Viszneki <donny.viszneki at gmail.com>wrote:

On Fri, Jan 23, 2009 at 5:45 PM, Jonathan Dearborn <@Jonathan_Dearborn> wrote:

Indefinitely without user interaction, yes. You have to press and
release
the offending key to stop the cursor from moving (or ship from spinning,
etc.). The best I’ve got right now is that you can press the opposite
direction to stop it as well (the natural reaction to a runaway cursor).

That’s a very different problem from any keyjamming problem I’ve ever
experienced. Just to be clear:

Depress Q
Depress W
Depress S
Release S
Release W
Release Q

Keyjamming problem: No events for S are ever sent.

This is a common problem, and this is the reason that so many games
use the modifier keys as buttons: because modifier keys are intended
for use in combination with other keys, they often get their own
circuits, which means they can be combined with more combinations of
keys.

I’ve never encountered a keyboard would send a KEYDOWN event for a
key, and then not send a KEYUP event even whenever all keys have
been released. You have a seriously shitty keyboard if that is the
case. Buy a new one! (Or, as I said earlier, replace the keyboard
controller!)


http://codebad.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hee hee, I don’t really want to replace my MacBook’s keyboard! Here’s a
usage case that does it for me:
Press Right arrow
Press Up arrow
Press Down arrow
Release Right arrow (This is the problem event)
Release Whatever

I’m not seeing this on my MacBook. In general keyboards have full support
for any of the arrow keys in any state.

Can you reproduce the problem with the checkkeys SDL test program?

See ya,
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Using xev with my ordinary PS/2 keyboard, here are the arrow key
combinations for which the last key mentioned doesn’t show up:

UP DOWN LEFT
LEFT UP RIGHT
LEFT UP DOWN

Supersets of these do work (for instance, UP DOWN RIGHT LEFT doesn’t
fail until LEFT)On Sun, Jan 25, 2009 at 11:21 AM, Sam Lantinga wrote:

Hee hee, I don’t really want to replace my MacBook’s keyboard! Here’s a
usage case that does it for me:
Press Right arrow
Press Up arrow
Press Down arrow
Release Right arrow (This is the problem event)
Release Whatever

I’m not seeing this on my MacBook. In general keyboards have full support
for any of the arrow keys in any state.

Can you reproduce the problem with the checkkeys SDL test program?


http://codebad.com/

Hee hee, I don’t really want to replace my MacBook’s keyboard!
Here’s a
usage case that does it for me:
Press Right arrow
Press Up arrow
Press Down arrow
Release Right arrow (This is the problem event)
Release Whatever

I’m not seeing this on my MacBook. In general keyboards have full
support
for any of the arrow keys in any state.

Can you reproduce the problem with the checkkeys SDL test program?

Using xev with my ordinary PS/2 keyboard, here are the arrow key
combinations for which the last key mentioned doesn’t show up:

UP DOWN LEFT
LEFT UP RIGHT
LEFT UP DOWN

Supersets of these do work (for instance, UP DOWN RIGHT LEFT doesn’t
fail until LEFT)

Hey, I haven’t followed the full discussion, just read these last two
mails, but I just want to note that I had very similar problems on my
MacBook (with Linux only, not with MacOSX). I already posted this
earlier to this list.

Here is the old discussion:
http://article.gmane.org/gmane.comp.lib.sdl/35999

It seems that the problems were related to the Linux kernel.

  • AlbertAm 25.01.2009 um 18:20 schrieb Donny Viszneki:

On Sun, Jan 25, 2009 at 11:21 AM, Sam Lantinga wrote: