Some keys cancel each other with 1.2.10 (not the typical keyboard bug)

Hi, it’s me again, albeit with a more valid complaint this time :slight_smile:

Some depressed keys are canceled by a spurious keyup event once any other
key on the keyboard is depressed. It is easy to rule out keyboard problems
in this case because if the keys are pressed in one order, the 2nd cancels
out the first, yet this does not happen if the keys are pressed in the
opposite order.

An example from my DOOM port is if I bind the “jump” command to J and hold
down J, subsequently pressing any arrow key cancels the J key’s down-state
with a ficititious, out-of-nowhere key up event that comes straight from SDL
(ie, it’s not a fabrication of some bug in my keybinding system). However,
if I already have one or more arrow keys depressed, pressing and holding J
has no ill effect. The assymetry is puzzling and makes my game look poorly
programmed.

However, the previous version of SDL had this bug with the ALT key, and that
appears to have now been fixed. I’m curious if it could thus be fixed for
all keys :slight_smile:

James Haley

That problem is called “ghost keys” and the problem lays at the hardware
level. SDL can’t help you.

For more information, read Keyboards Are Evil by Steve Baker:
http://www.sjbaker.org/steve/omniv/keyboards_are_evil.html

Cache as the server is currently dead:
http://66.249.93.104/search?q=cache:glmFIWupTOQJ:www.sjbaker.org/steve/omniv/keyboards_are_evil.html

Cheers,
RicardoEm Segunda, 29 de Maio de 2006 08:03, o James Haley escreveu:

Hi, it’s me again, albeit with a more valid complaint this time :slight_smile:

Some depressed keys are canceled by a spurious keyup event once any other
key on the keyboard is depressed. It is easy to rule out keyboard problems
in this case because if the keys are pressed in one order, the 2nd cancels
out the first, yet this does not happen if the keys are pressed in the
opposite order.

An example from my DOOM port is if I bind the “jump” command to J and hold
down J, subsequently pressing any arrow key cancels the J key’s
down-state with a ficititious, out-of-nowhere key up event that comes
straight from SDL (ie, it’s not a fabrication of some bug in my keybinding
system). However, if I already have one or more arrow keys depressed,
pressing and holding J has no ill effect. The assymetry is puzzling and
makes my game look poorly programmed.

However, the previous version of SDL had this bug with the ALT key, and
that appears to have now been fixed. I’m curious if it could thus be fixed
for all keys :slight_smile:

James Haley


Tax reform means “Don’t tax you, don’t tax me, tax that fellow behind
the tree.”
– Russell Long

Well it may be the case, but I find it suspicious because like I said, the
ALT key suffered the same problem before 1.2.10 but is now fixed, and I
haven’t changed keyboards since then :slight_smile:

Also, it doesn’t seem to matter what alphanumeric key I hold down; the
arrows cancel all of them, and only if I press the alphanumeric key first.
If I press the arrow key and then the alphanumeric key, both keys continue
to repeat. If this were truly a hardware limitation, wouldn’t it be
symmetric in nature? I know on my PII box, if two keys cancel each other,
they do so symmetrically and it doesn’t matter which I press first or
second.

For these reasons, I’m not entirely sure there’s not something going on in
the software level that could be tweaked to improve this. It was clearly
done with the ALT key between 1.2.7 and 1.2.10, even though I’ve as of yet
found no mention of this change in the changelogs. :slight_smile:

James Haley>From: Ricardo Cruz

Reply-To: “A list for developers using the SDL library.
(includesSDL-announce)”
To: "A list for developers using the SDL library. (includes
SDL-announce)"
Subject: Re: [SDL] Some keys cancel each other with 1.2.10 (not the
typicalkeyboard bug)
Date: Mon, 29 May 2006 16:30:10 +0100
MIME-Version: 1.0
Received: from twomix.devolution.com ([206.58.251.131]) by
bay0-mc6-f18.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Mon,
29 May 2006 08:24:52 -0700
Received: from localhost([127.0.0.1] helo=twomix.devolution.com
ident=mailman)by twomix.devolution.com with esmtp (Exim 4.50)id
1Fkjbw-0001Rw-6ffor @James_Haley; Mon, 29 May 2006 08:24:52 -0700
Received: from mailrly06.isp.novis.pt ([195.23.133.216])by
twomix.devolution.com with esmtp (Exim 4.50) id 1FkjbX-0001M4-S3for
sdl at libsdl.org; Mon, 29 May 2006 08:24:28 -0700
Received: (qmail 4585 invoked from network); 29 May 2006 15:24:17 -0000
Received: from unknown (HELO mailfrt04.isp.novis.pt)
([195.23.133.196])(envelope-sender )by
mailrly06.isp.novis.pt with compressed SMTP;29 May 2006 15:24:17 -0000
Received: (qmail 8199 invoked from network); 29 May 2006 15:24:16 -0000
Received: from unknown (HELO
[10.0.0.2])(Sent_by_authenticated_user_x2476431@[87.196.40.206])(envelope-sender
)by mailfrt04.isp.novis.pt with SMTP; 29 May 2006 15:24:16
-0000
X-Message-Info: LsUYwwHHNt3660MmjhEvYg2f34OAemlKtU9j2Z7TuGo=
User-Agent: KMail/1.9.1
References:
X-Face: $29d{(U~(^/X.rR|7i6syM3jeJ<L<fz;!^8.d&]vw+B.F%3$1z>}N+*%U-#Bzl5
X-Virus-Scanner: Scanned by CLAMAV on devolution.com
X-BeenThere: sdl at libsdl.org
X-Mailman-Version: 2.1.7
Precedence: list
List-Id: “A list for developers using the SDL library.
(includesSDL-announce)” <sdl.libsdl.org>
List-Unsubscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=unsubscribe>
List-Archive: http://www.libsdl.org/pipermail/sdl
List-Post: <mailto:sdl at libsdl.org>
List-Help: <mailto:sdl-request at libsdl.org?subject=help>
List-Subscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=subscribe>
Errors-To: sdl-bounces+haleyjd=hotmail.com at libsdl.org
X-Virus-Scanner: Scanned by CLAMAV on devolution.com
Return-Path: sdl-bounces+haleyjd=hotmail.com at libsdl.org
X-OriginalArrivalTime: 29 May 2006 15:24:53.0140 (UTC)
FILETIME=[08896D40:01C68334]

That problem is called “ghost keys” and the problem lays at the hardware
level. SDL can’t help you.

For more information, read Keyboards Are Evil by Steve Baker:
http://www.sjbaker.org/steve/omniv/keyboards_are_evil.html

Cache as the server is currently dead:
http://66.249.93.104/search?q=cache:glmFIWupTOQJ:www.sjbaker.org/steve/omniv/keyboards_are_evil.html

Cheers,
Ricardo

Em Segunda, 29 de Maio de 2006 08:03, o James Haley escreveu:

Hi, it’s me again, albeit with a more valid complaint this time :slight_smile:

Some depressed keys are canceled by a spurious keyup event once any
other
key on the keyboard is depressed. It is easy to rule out keyboard
problems
in this case because if the keys are pressed in one order, the 2nd
cancels
out the first, yet this does not happen if the keys are pressed in the
opposite order.

An example from my DOOM port is if I bind the “jump” command to J and
hold
down J, subsequently pressing any arrow key cancels the J key’s
down-state with a ficititious, out-of-nowhere key up event that comes
straight from SDL (ie, it’s not a fabrication of some bug in my
keybinding
system). However, if I already have one or more arrow keys depressed,
pressing and holding J has no ill effect. The assymetry is puzzling and
makes my game look poorly programmed.

However, the previous version of SDL had this bug with the ALT key, and
that appears to have now been fixed. I’m curious if it could thus be
fixed
for all keys :slight_smile:

James Haley


Tax reform means “Don’t tax you, don’t tax me, tax that fellow behind
the tree.”
– Russell Long


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

James Haley wrote:

If I press the arrow key and then the alphanumeric key, both keys continue
to repeat.

I know that PC keyboards have built-in repetition which is limited to
30 triggers per second and often set to a lower rate by default.
However, isn’t the right way just considering a key pressed until you
see a release event? I believe (hardware) auto-repeat is only useful
for typing and even then you can just emulate it in software.–
Christian
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060529/7c8e29d1/attachment.pgp

Christian Biere wrote:

I know that PC keyboards have built-in repetition which is limited to
30 triggers per second and often set to a lower rate by default.

I do not believe so. The typematic rates (that’s what they are called) are
set in software, and PC keyboards (at least all that I ever worked with)
only send scan codes with an up/down bit via a special serial port
interface.

-Alex.

Alex Volkov wrote:

Christian Biere wrote:

I know that PC keyboards have built-in repetition which is limited to
30 triggers per second and often set to a lower rate by default.

I do not believe so. The typematic rates (that’s what they are called) are
set in software,

Just google for keyboard port 60 repeat. It’s a hardware feature.

and PC keyboards (at least all that I ever worked with)
only send scan codes with an up/down bit via a special serial port
interface.

It doesn’t matter whether it’s an AT interface - I assume that’s
what’s you mean with “special serial port” - or a PS/2 interface.
The latter certainly has additional features I’ve never used.–
Christian
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060530/297a5c82/attachment.pgp

Im with James on this one.

I have a program that uses shift+arrow keys under win32.

On SDL 1.2.9:
If I press shift first and then the arrow the shift key is depressed.
But if I press arrow first and then shift, the arrow key is not depressed.

First I thought this was a bug in my program and since it’s just a test
program, I didn’t bother fixing it.
But then came SDL 1.2.10 and the problem dissapeared. I have just (like in
"now") tested it both with SDL 1.2.9 and 1.2.10
So I can’t see it any other way, than this is a SDL-thing.

This is only on my old IBM laptop.

On my old home-pc it works in both versions.

Let me now if you want the program and/or specs on the two machines or any
other thing to clear this up.

Take care
Martin

James Haley wrote:

Well it may be the case, but I find it suspicious because like I said,
the ALT key suffered the same problem before 1.2.10 but is now fixed

That was a different problem, IIRC.

Also, it doesn’t seem to matter what alphanumeric key I hold down;
the arrows cancel all of them, and only if I press the alphanumeric
key first.
If I press the arrow key and then the alphanumeric key, both keys
continue to repeat. If this were truly a hardware limitation, wouldn’t
it be symmetric in nature?

It does not have to be symmetric. Keyboard makers save on wiring and
controller complexity by creating signal matrices which make certain
key-press combinations impossible to detect.
On my old-school IBM keyboard, for example, pressing any digit on the numpad
"unpresses" the Right Shift key, but only when the Num Lock in ON ;-). With
Num Lock OFF this does not happen. Also, pressing any numpad digit first and
then pressing Right Shift behaves as expected too (w/o regard to Num Lock).
In other words, what I am trying to say is do not look for symmetry and/or
rationale here, and try a completely different brand of keyboard. Chances
are, a different keyboard will have different jamming problems and different
ghosting behavior.

-Alex.

Well, it’s great to know I’m not just insane and imagining the entire thing
:slight_smile:

It appears that modifiers + arrow keys are fixed under 1.2.10, as you say
pressing shift now works, and for me, pressing alt now works. However, for
the other keys, like alphanumerics, it is not fixed. So, the question is,
what
is the difference in how SDL is handling modifier keys from how it is
handling other keys, and what between 1.2.9 and 1.2.10 was changed to
make this difference?

James Haley.>From: “Martin Lange”

Reply-To: “A list for developers using the SDL library.
(includesSDL-announce)”
To: sdl at libsdl.org
Subject: Re: [SDL] Some keys cancel each other with 1.2.10 (not
thetypicalkeyboard bug)
Date: Tue, 30 May 2006 20:46:36 +0200

Im with James on this one.

I have a program that uses shift+arrow keys under win32.

On SDL 1.2.9:
If I press shift first and then the arrow the shift key is depressed.
But if I press arrow first and then shift, the arrow key is not depressed.

First I thought this was a bug in my program and since it’s just a test
program, I didn’t bother fixing it.
But then came SDL 1.2.10 and the problem dissapeared. I have just (like in
"now") tested it both with SDL 1.2.9 and 1.2.10
So I can’t see it any other way, than this is a SDL-thing.

This is only on my old IBM laptop.

On my old home-pc it works in both versions.

Let me now if you want the program and/or specs on the two machines or any
other thing to clear this up.

Take care
Martin


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

James Haley wrote:

It appears that modifiers + arrow keys are fixed under 1.2.10, as you
say pressing shift now works, and for me, pressing alt now works.
However, for the other keys, like alphanumerics, it is not fixed.

I am not so sure it is “fixed”, but see below.

Martin Lange wrote:

But then came SDL 1.2.10 and the problem disappeared. I have just
(like in “now”) tested it both with SDL 1.2.9 and 1.2.10 So I can’t
see it any other way, than this is a SDL-thing.

Could be the same “fixed” issue, but see below.

So, the question is, what is the difference in how SDL is handling
modifier keys from how it is handling other keys, and what between
1.2.9 and 1.2.10 was changed to make this difference?

The biggest difference is that SDL 1.2.10 ships with Windib driver being
default, while 1.2.9 had DirectX as default. Unfortunately, it appears that
Windib keyboard handling did not receive enough testing originally (probably
because everyone was using DirectX so far), so it still has some quirks in
1.2.10. A number of Windib keyboard things have been fixed in SVN since
1.2.10 release (see http://bugzilla.libsdl.org/show_bug.cgi?id=164).
The handling of keyboard events in Windib and DirectX drivers is very
different: DirectX uses scancodes only, and Windib uses Windows virtual
keys.

Note that on my Win2k system, both drivers in both SDL versions are working
fine with shift + arrow keys and J + arrow keys.

If you really want to test what got fixed and what got broken, you should
force the driver with SDL_VIDEODRIVER envvar:
C> set SDL_VIDEODRIVER=directx (or windib)
C> my_app.exe

-Alex.

Ah, I see. So the difference is primarily coming from the difference in
drivers being used.

Whatever happens, I hope that the shift/alt + arrows issue doesn’t return,
because it
makes it a wee bit difficult to run or strafe in a first person shooter game
when this
combination of keys cannot be used :slight_smile:

James Haley>From: “Alex Volkov”

Reply-To: “A list for developers using the SDL library.
(includesSDL-announce)”
To: "‘A list for developers using the SDL library.
(includesSDL-announce)’"
Subject: Re: [SDL] Some keys cancel each other with
1.2.10(notthetypicalkeyboard bug)
Date: Fri, 2 Jun 2006 11:53:51 -0400

James Haley wrote:

It appears that modifiers + arrow keys are fixed under 1.2.10, as you
say pressing shift now works, and for me, pressing alt now works.
However, for the other keys, like alphanumerics, it is not fixed.

I am not so sure it is “fixed”, but see below.

Martin Lange wrote:

But then came SDL 1.2.10 and the problem disappeared. I have just
(like in “now”) tested it both with SDL 1.2.9 and 1.2.10 So I can’t
see it any other way, than this is a SDL-thing.

Could be the same “fixed” issue, but see below.

So, the question is, what is the difference in how SDL is handling
modifier keys from how it is handling other keys, and what between
1.2.9 and 1.2.10 was changed to make this difference?

The biggest difference is that SDL 1.2.10 ships with Windib driver being
default, while 1.2.9 had DirectX as default. Unfortunately, it appears that
Windib keyboard handling did not receive enough testing originally
(probably
because everyone was using DirectX so far), so it still has some quirks in
1.2.10. A number of Windib keyboard things have been fixed in SVN since
1.2.10 release (see http://bugzilla.libsdl.org/show_bug.cgi?id=164).
The handling of keyboard events in Windib and DirectX drivers is very
different: DirectX uses scancodes only, and Windib uses Windows virtual
keys.

Note that on my Win2k system, both drivers in both SDL versions are working
fine with shift + arrow keys and J + arrow keys.

If you really want to test what got fixed and what got broken, you should
force the driver with SDL_VIDEODRIVER envvar:
C> set SDL_VIDEODRIVER=directx (or windib)
C> my_app.exe

-Alex.


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

James Haley wrote:

I hope that the shift/alt + arrows issue doesn’t return, because it
makes it a wee bit difficult to run or strafe in a first person shooter
game

This is not exactly on topic, and I do see your point, but… The days of
Duke3d are over! :wink:
Strafe modifiers are pretty pointless with modern Forward/Backward/Strafe
Left/Strafe Right + Mouse layouts.

-Alex.