🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Using GetAsyncKeyState() ?!!

#14395
From: Schandler
Date: Mon, 18 Aug 2003 08:20
35 lines
2111 bytes
Thanks Dennis, your solution made it work perfectly.
thanks again

Schandler,


"Dennis Jones" <djones@nospam.com> wrote in message
news:3f3fcc6b$1@newsgroups.borland.com...
>
> "Chris Hill" <Chris244@aol.com> wrote in message
> news:3f3f5610.3143789530@forums.borland.com...
> > On Sun, 17 Aug 2003 11:08:23 +0300, "Schandler"
> > <theslider@programmer.net> wrote:
> >
> > >I want to use the api function GetAsyncKeyState (int vkey) to know if a
> > >specified key is down at the moment I'm calling the function
> > >the win32 api help says that the function detectes if the key is down
if
> the
> > >"most significant bit is set" !! which I don't know what it means
> > >I tried to call the function to check if the Shift key is pressed on
> windows
> > >98 as follows
> >
> > Try this:
> > int keydown = (GetAsyncKeyState(VK_SHIFT) < 0);
>
> Or, more explicitly, check the most significant bit:
>
> bool keydown = ((GetAsyncKeyState(VK_SHIFT) & 0x8000) == 0x8000);
>
> - Dennis
>
>
>
Technical Details
Message-ID: <3f41d5dd@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!nntp.giganews.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f3f3635@newsgroups.borland.com> <3f3f5610.3143789530@forums.borland.com> <3f3fcc6b$1@newsgroups.borland.com>

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-19 01:14:18 PST
From: "Schandler" <theslider@programmer.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f3f3635@newsgroups.borland.com> <3f3f5610.3143789530@forums.borland.com> <3f3fcc6b$1@newsgroups.borland.com>
Subject: Re: Using GetAsyncKeyState() ?!!
Date: Mon, 18 Aug 2003 11:20:54 +0300
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: 62.135.27.59
Message-ID: <3f41d5dd@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1061279197 62.135.27.59 (19 Aug 2003 00:46:37 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!nntp.giganews.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail