🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

R: OnKeyPress

#15614
From: Steve_Aletto
Date: Mon, 23 Jun 2003 12:06
32 lines
1724 bytes
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: <3ef6ed5e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ef600fe$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 05:20:52 PST
Reply-To: "Steve_Aletto" <steve_alettoANTI@SPAMhotmail.com>
From: "Steve_Aletto" <steve_alettoANTI@SPAMhotmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ef600fe$1@newsgroups.borland.com>
Subject: R: OnKeyPress
Date: Mon, 23 Jun 2003 14:06:46 +0200
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
NNTP-Posting-Host: 80.105.101.132
Message-ID: <3ef6ed5e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1056370014 80.105.101.132 (23 Jun 2003 05:06:54 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail