Re: [AD] Problem with key_shifts on Windows.

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


can these problems be demonstrated/or not  in the /examples/exkeys.exe  ?



Andrei Ellman wrote:
Hi,

I have found a bug in the behaviour of the key_shifts variable in Windows. Sometimes, the appropriate flag does not get set when a shift/ctrl/alt key is pressed, and when the key is released, the flag is set.

When I run the attatched program on Windows (both W2K and W98), the message to say if SHIFT/CTRL/ALT is held down is not displayed on startup, not displayed when the key is pressed, but only displayed once the key is released. Also, if a second SHIFT/CTRL/ALT key is pressed while the first key is held down, then the flag for the first key becomes set. If the first key is then released, the flag for the second key is set. If however the second key is released before the first key is released, then the flag for the second key is set.

Another thing I notice is that as long as the flag for CTRL is set, ESC does not work, and if the flag for ALT is set, neither ESC or SPACE works (I've not tried any other keys).

I have tried compiling my example with both MSVC6 and GCC 3.4.4 (Cygwin), and both exes produce the same result.

However, I tried the DOS version (DJGPP under W98), and it behaved as expected (the flags were unly set while the keys they represented were held down).

I am using Allegro 4.2.0 under both DJGPP, MSVC (both W98 and W2K) and Cygwin.

Also in the Windows, if ALT-GR is released, it sets both the ALT and CTRL flags in key_shifts, but in the DOS version, ALT-GR only sets the ALT flag when pressed. I have a UK keyboard.

Incidentally, this bug manifests itself in the Allegro grabber under Windows. I sometimes find that I end up selecting multiple-objects when I only want to select one. If I hold down SHIFT, this problem disappears.

AE.




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