Re: [AD] Patch for wkeybd.c

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I forgot to say, the patch is for Allegro 4.2 (4.2.3 SVN).

On Sun, 09 Sep 2007 21:30:22 -0300, David A. Capello <davidcapello@xxxxxxxxxx> wrote:

Hello everybody. How are the Allegro community?
I was an old Allegro user, and I abandoned a little
the library to see other things in Windows. Anyway,
I'm back :)

And I found a bug with the keyboard handler of Windows.
Mainly the state of SHIFT, CTRL and ALT keys in the
global variable "key_shifts" aren't working right.

I think that the problems is because "GetKeyboardState"
is getting an old state of the keyboard (before to
process the queue of messages). So using "GetAsyncKeyState"
fix the problem. Anyway, I'm not very sure about the
cause of the bug.

I attached a simple test (bug.c) and a patch for
the src/win/wkeybd.c file which fix the problem.

Good bye






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/