ALT Key Weirdness under Win32

Under Win32, some odd things seem to happen with the ALT key state when
changing the active window. I haven’t yet managed to nail it down to a set
of steps to repro yet, but I can at least outline the symptoms.

Basically, I use ALT-Tab for task switching a lot, but if I already have my
hand on the mouse, I’ll use the task bar to switch. Often, after switching
away from an SDL app then back again I have issues. Noteably, the ALT-Tabs
seem to get passed as events (not just the initial one either), and the ALT
key seems to get “stuck” that is, any keydown event has one of the KMOD_ALT
bits set. I’ve added code to silently ignore ALT-Tabs (easy 'nuff) but I
can’t figure out a way to “unstick” the ALT key status when focus is
returned.

I haven’t had this problem with any other platform.

The code can be viewed here:
http://cvs.synchro.net/cgi-bin/viewcvs.cgi/src/conio/sdl_con.c?rev=HEAD&content-type=text/vnd.viewcvs-markup
Around line 1426.

Not on list… reply all is your friend etc.

I suffer the same kind of symptom on linux.

I have set my F Keys to do a certain OS-Sided stuff (F1=move window to
the back, F2=Move window, F3=minimize window, etc…). The Fkeys
works if NumLock is not on and if it is on, i get the key pressed as
sdl events.

This is not a problem, it is a feature in my opinion.

HTH,
SimonOn 2/17/06, Stephen Hurd wrote:

Under Win32, some odd things seem to happen with the ALT key state when
changing the active window. I haven’t yet managed to nail it down to a set
of steps to repro yet, but I can at least outline the symptoms.

Basically, I use ALT-Tab for task switching a lot, but if I already have my
hand on the mouse, I’ll use the task bar to switch. Often, after switching
away from an SDL app then back again I have issues. Noteably, the ALT-Tabs
seem to get passed as events (not just the initial one either), and the ALT
key seems to get “stuck” that is, any keydown event has one of the KMOD_ALT
bits set. I’ve added code to silently ignore ALT-Tabs (easy 'nuff) but I
can’t figure out a way to “unstick” the ALT key status when focus is
returned.

I haven’t had this problem with any other platform.

The code can be viewed here:
http://cvs.synchro.net/cgi-bin/viewcvs.cgi/src/conio/sdl_con.c?rev=HEAD&content-type=text/vnd.viewcvs-markup
Around line 1426.

Not on list… reply all is your friend etc.


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

Under Win32, some odd things seem to happen with the ALT key state when
changing the active window. I haven’t yet managed to nail it down to a set
of steps to repro yet, but I can at least outline the symptoms.

Can you test this with the latest CVS?
http://www.libsdl.org/cvs/SDL.dll

If it’s still broken, can you submit the bug to bugzilla?
http://bugzilla.libsdl.org/

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment