🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Virtual Key problem

#16149
From: Nicholas Gessler
Date: Wed, 28 May 2003 20:37
31 lines
2238 bytes
"Eudy Carvalhaes C. Silva" <eudy@iae.cta> wrote in message
news:3ED51111.9080904@iae.cta...
> Use EditBox->SetFocus( ) for that.

OK, that works great!!!

So in summary, here's a simple workaround to enable the ArrowKeys on the
Form:

For the Form:
    Set KeyPreview = true
    Create the OnKeyDown event handler
    Put your VK_LEFT, RIGHT, UP, DOWN "if" statements in the handler...

At this point the KeyDown event will work but the ArrowKeys won't be
recognized...

So, put an EditBox on the Form:
    (This evidently sends the required Windows Messages to have the
ArrowKeys recognized.)
    Keep it Enabled = true; but set the Height and Width to 0 (that will
make it disappear!)
    (If you set Visible = false you will get an error message.)
    Put the EditBox->SetFocus( ); statement in your code whereever you need
it.

Whew!!!  That was a long one.  I'm sure this is not the "proper" way to do
it, but it's easy and it seems to work!
Thanks Remy and Eudy!

Nick
Technical Details
Message-ID: <3ed51dc9@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3ed17b8f@newsgroups.borland.com> <3ed1839d$1@newsgroups.borland.com> <3ed2e51d@newsgroups.borland.com> <3ED4DFC2.3060603@directnet.com> <3ed501cc@newsgroups.borland.com> <3ed507be@newsgroups.borland.com> <3ED51111.9080904@iae.cta>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,b34f1e4dec3a67c2
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-05-28 14:08:07 PST
Reply-To: "Nicholas Gessler" <gessler@ucla.edu>
From: "Nicholas Gessler" <gessler@ucla.edu>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ed17b8f@newsgroups.borland.com> <3ed1839d$1@newsgroups.borland.com> <3ed2e51d@newsgroups.borland.com> <3ED4DFC2.3060603@directnet.com> <3ed501cc@newsgroups.borland.com> <3ed507be@newsgroups.borland.com> <3ED51111.9080904@iae.cta>
Subject: Re: Virtual Key problem
Date: Wed, 28 May 2003 13:37:56 -0700
Lines: 33
Organization: UCLA - Geography
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: 4.60.108.106
Message-ID: <3ed51dc9@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1054154185 4.60.108.106 (28 May 2003 13:36:25 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail