🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: OnKeyPress

#15627
From: Chris
Date: Mon, 23 Jun 2003 20:58
41 lines
1976 bytes
Since neither events detect the automatic repeats, it wouldn't change a
thing, but thank you for your suggestion.

Chris.

"Steve_Aletto" <steve_alettoANTI@SPAMhotmail.com> wrote in message
news:3ef6ed5e$1@newsgroups.borland.com...
> Chris <Chris8852@adelphia.net> wrote in message
> 3ef600fe$1@newsgroups.borland.com...
> > I need to retrieve the OnKeyPress event for the arrow keys
> in TStringGrid.
> > OnKeyUp and Down won't work because it doesn't detect the
> automatic
> > repeating.
>
> Could the following be a solution (or at least a suggestion,
> only the down key is handled)?
>
> bool DownArrowPressed = false;
>
> void __fastcall TForm1::StringGrid1KeyDown(TObject *Sender,
> WORD &Key,
>    TShiftState Shift)
> {
>  if ((Key == VK_DOWN) && (!DownArrowPressed))
>  {
>   DownArrowPressed = true;
>   /* do something */
>  }
> }
>
> void __fastcall TForm1::StringGrid1KeyUp(TObject *Sender,
> WORD &Key,
>    TShiftState Shift)
> {
>  if (Key == VK_DOWN) DownArrowPressed = false;
> }
>
> Steve.
>
>
Technical Details
Message-ID: <3ef76a08$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ef600fe$1@newsgroups.borland.com> <3ef6ed5e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,3969142b6c9bc6db
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-06-23 14:05:57 PST
From: "Chris" <Chris8852@adelphia.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ef600fe$1@newsgroups.borland.com> <3ef6ed5e$1@newsgroups.borland.com>
Subject: Re: OnKeyPress
Date: Mon, 23 Jun 2003 16:58:49 -0400
Lines: 43
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: 68.65.164.124
Message-ID: <3ef76a08$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1056401928 68.65.164.124 (23 Jun 2003 13:58:48 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail