🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14347

Re: Using GetAsyncKeyState() ?!!

#14347
From: Chris Hill
Date: Sun, 17 Aug 2003 20:37
21 lines
1632 bytes
On Sun, 17 Aug 2003 21:21:57 +0200, Michel Corbin
<corbin.michel@libertysurf.fr> wrote:

>To know if a key is down at the moment you are calling the function,
>I think it is better to write :
>if(GetKeyState(VK_SHIFT)<0)
>{
>  ...
>}
>GetAsyncKeyState(VK_SHIFT<0) is true if the key has been down since
>the last call of the function (That is what I've understood)

No, the GetKeyState return value only changes as messages are
processed.

GetAsyncKeyState checks the state independent of message processing.
The least significant bit of the GetAsyncKeyState function return
value which is that you are describing isn't very useful in practice.

Chris Hill
Chris244@aol.com
Technical Details
Message-ID: <3f3fe5b2.3180560133@forums.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!skynet.be!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f3f3635@newsgroups.borland.com> <3F3FD5D4.FF6CEAF@libertysurf.fr>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,64528418f36af68
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-17 13:40:20 PST
From: Chris244@aol.com (Chris Hill)
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Using GetAsyncKeyState() ?!!
Date: Sun, 17 Aug 2003 20:37:16 GMT
Message-ID: <3f3fe5b2.3180560133@forums.borland.com>
References: <3f3f3635@newsgroups.borland.com> <3F3FD5D4.FF6CEAF@libertysurf.fr>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: 12.221.66.183
X-Trace: newsgroups.borland.com 1061152634 12.221.66.183 (17 Aug 2003 13:37:14 -0700)
Lines: 21
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!skynet.be!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail