RE: [GD-Windows] GetAsyncKeyState / DI
Brought to you by:
vexxed72
From: Andy G. <an...@mi...> - 2002-11-06 21:26:09
|
Why use GetAsyncKeyState or DirectInput for typical keyboard handling at = all? You are going to get WM_KEYUP and WM_KEYDOWN messages all the time - = it's pretty easy to store these results in an array - then you can have = perfect up/down/pressed notifications that do not have any input focus = issues. Andy. -----Original Message----- From: Ignacio Casta=F1o [mailto:cas...@ya...]=20 Sent: Wednesday, November 06, 2002 10:10 AM To: gam...@li... Subject: RE: [GD-Windows] GetAsyncKeyState / DI Wayne Coles wrote:=20 > Unfortunately the remarks section inside the MSDN documentation go on=20 > to > say: >=20 > "Although the least significant bit of the return value indicates=20 > whether the key has been pressed since the last query, due to the=20 > pre-emptive multitasking nature of Windows, another application can=20 > call GetAsyncKeyState and receive the "recently pressed" bit instead=20 > of your application. The behavior of the least significant bit of the=20 > return value is retained strictly for compatibility with 16-bit=20 > Windows applications (which are non-preemptive) and should not be=20 > relied upon." >=20 > So you can't really rely upon this bit being set correctly. Exactly, that's what I meant, the interface of GetAsyncKeyState is nice, = but the real behaviour is not. Ignacio Casta=F1o cas...@ya... _______________________________________________________________ Yahoo! Messenger Nueva versi=F3n: Webcam, voz, y mucho m=E1s =A1Gratis!=20 Desc=E1rgalo ya desde http://messenger.yahoo.es ------------------------------------------------------- This sf.net email is sponsored by: See the NEW Palm=20 Tungsten T handheld. Power & Color in a compact size! = http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en _______________________________________________ Gamedevlists-windows mailing list = Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 |