Article View: borland.public.cppbuilder.nativeapi
Article #9167Re: Windows spacebar hotkey
From: Chris Croughton
Date: Thu, 29 Jul 2004 12:46
Date: Thu, 29 Jul 2004 12:46
38 lines
2400 bytes
2400 bytes
On 29 Jul 2004 01:16:20 -0700, Andrue Cope [TeamB] <no.spam@spammy.com> wrote: > Chris Croughton wrote: > >> Keys like tab, space and >> the arrow keys don't do the same thing there, and I doubt if anyone >> would want them to do so whether it's a 'standard' UI feature or not. > > They certainly will in a dialog box. Pressing space while an edit > control has the focus causes a space to be inserted. Even if you > develop your own component it will not respond to [space] unless it has > a reason to do so. I don't want a dialog box, and I don't want anything to grab either space or the cursor keys. Think of a terminal emulator, for instance, where the cursor keys need to send the appropriate codes to the other end. > I have developed an editor using a TBitmap to draw the text on and > there was never any reason to disable [space]. It gets handled along > with all the other non editing keys in the OnKeyPress handler with no > effort on my part. TPaintBox doesn't have an OnKeyPress handler as far as I can see, which is the other one I want. > The OP asked how to prevent [space] from activating a button and the > only time it will do that is when that button has the focus. It doesn't > matter what application you are developing. If a button has the focus > then it is part of the Windows UI specification that pressing [space] > will click it. So the answer is to always move the focus to something else which doesn't have that action but does have an OnKeyPress event, yes? What would be suggested as a control which can receive do that? Chris C
Technical Details
Message-ID:
<slrncghsd7.7ug.chris@ccserver.keris.net>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mailReferences:
<4107b926$1@newsgroups.borland.com> <4107c851@newsgroups.borland.com> <slrncgg2ei.f6p.chris@ccserver.keris.net> <4108b254$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,af0a7a309a9df709 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Croughton <chris@keristor.net> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Windows spacebar hotkey Date: Thu, 29 Jul 2004 13:46:31 +0100 Lines: 38 Message-ID: <slrncghsd7.7ug.chris@ccserver.keris.net> References: <4107b926$1@newsgroups.borland.com> <4107c851@newsgroups.borland.com> <slrncgg2ei.f6p.chris@ccserver.keris.net> <4108b254$1@newsgroups.borland.com> Reply-To: chris@keristor.net X-Trace: news.uni-berlin.de pcIRNNHEOKcD0r2rb3hV4g1Va7QXJiOKBOem13wmnnXbsFKzQ= X-Orig-Path: ccserver.keris.net!news User-Agent: slrn/0.9.7.4 (Linux)