πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Using GetAsyncKeyState() ?!!

#14345
From: Dennis Jones
Date: Sun, 17 Aug 2003 20:16
22 lines
1841 bytes
"Michel Corbin" <corbin.michel@libertysurf.fr> wrote in message
news:3F3FD5D4.FF6CEAF@libertysurf.fr...
> Schandler a οΏ½crit :

> 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)

You have understood incorrectly.  If the MSB of the value returned is set,
then the key is down currently.

From the Win32 help:

"If the function succeeds, the return value specifies whether the key was
pressed since the last call to GetAsyncKeyState, and whether the key is
currently up or down. If the most significant bit is set, the key is down,
and if the least significant bit is set, the key was pressed after the
previous call to GetAsyncKeyState."

It is therefore possible to determine both from a single call.

- Dennis
Technical Details
Message-ID: <3f3fe29d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!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
X-Google-Thread: 10cc67,64528418f36af68
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-17 13:40:19 PST
From: "Dennis Jones" <djones@nospam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f3f3635@newsgroups.borland.com> <3F3FD5D4.FF6CEAF@libertysurf.fr>
Subject: Re: Using GetAsyncKeyState() ?!!
Date: Sun, 17 Aug 2003 13:16:30 -0700
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 204.200.27.7
Message-ID: <3f3fe29d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1061151389 204.200.27.7 (17 Aug 2003 13:16:29 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!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