Re: [AD] Breakpointing an app in the MSVC 6 debugger can get a key to be stuck in Windows 2000

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


On 2005-12-28, Andrei Ellman <ae-a-alleg@xxxxxxxxxx> wrote:
> The following test program demonstrates a problem with the keyboard 
> driver when debugging an app with MSVC 6 under Windows 2000. The program 
> is supposed to display a message when the F2 key is held down and clear 
> it when it is not held down. However, if I am debugging the program 
> using the MSVC 6 debugger and I place a breakpoint on the line that is 
> only supposed to be execuded if key[KEY_F2], then when I press F2, the 
> compiler stops at the breakpoint, but if I release F2 before I resume, 
> then the F2 key appears to be stuck. Only pressing F2 again can unstick 
> it. Even pressing other keys does not unstick it.

Actually, this is the behaviour I would expect.  I don't know why
Windows 98 acts differently.

You can try this test.  Using a windowed graphics driver, set a
SWITCH_IN and SWITCH_OUT callback with set_display_switch_callback() and
see if the callback is called before and after you enter the breakpoint.

I think what may be happening under Windows 98 is that the window
receives the WM_ACTIVATE message, which is handled in wwnd.c, which
calls _win_switch_out(), which calls key_dinput_unacquire() which clears
the key[] array.  Perhaps that doesn't happen under Windows 2000.

Peter





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