Board index » cppbuilder » KeyDownEvent Not Firing For Arrow Keys

KeyDownEvent Not Firing For Arrow Keys


2003-11-24 10:31:19 PM
cppbuilder52
Hi all,
I have inherited a C++ Builder 5 project (which I have now upgraded to v6).
This is an ActiveX control that derives from TEdit, adding a few extra
properties.
However, the KeyDownEvent does not fire when the arrow keys are used. It
fires OK when all other keys are pressed. I have tried a standard .exe
project and the KeyDownEvent does fire for the arrow keys.
When the arrow keys are pressed in my OCX, it moves the focus to the next
control (in the case of Right & Down) and to the previous control (in the
case of Left & Up).
I'm a VB programmer not a C++ programmer so please be gentle. I do know
enough to get by, but I can't understand why this event is not firing.
Any ideas?
Thanks,
Steve
 
 

Re:KeyDownEvent Not Firing For Arrow Keys

"Steve Fulleylove" < XXXX@XXXXX.COM >wrote in message
I have inherited a C++ Builder 5 project (which I have now upgraded to
v6).
Quote
This is an ActiveX control that derives from TEdit, adding a few
extra
properties.

However, the KeyDownEvent does not fire when the arrow keys are
used. It
fires OK when all other keys are pressed. I have tried a standard
.exe
project and the KeyDownEvent does fire for the arrow keys.
Steve, I take you at your word here. But I wonder if you mean a
*non-BCB* .exe? I don't write Active X's, but I don't think that's
the source of your problem. Please read this reference and let us
know if it is of any help! I'm not being un-gentle, but if you post
again, be sure to clearly describe what the project does with the
keystrokes. Does it override a TEdit method, use the exposed
OnKeyDown property (a pointer to a function), or what?
www.bcbdev.com/faqs/faq78.htm
 

Re:KeyDownEvent Not Firing For Arrow Keys

Timothy,
Thanks for replying. Sorry if I'm not being very specific, but my C++
skills are limited and I'm not 100% sure how the program works.
The program creates an OCX control (and a DLL) that derives from TEdit, but
adds a few extra properties. When I debug the program, the OnKeyDown event
does not fire when using the arrow keys (all other keys work including the
shift keys and windows keys). The OnKeyDown event is overriden to provide
some additional formatting, but it never even fires when the arrow keys are
pressed so the code in there cannot be causing the problem (I originally
thought this would be were the problem was).
When I write a very simple C++ program with just the standard TEdit control
on it, the OnKeyDown event does fire for the arrow keys, so I know that this
control does capture the arrow keys.
I tried adding the WMGetDlgCode function from the web page that you pointed
me to, but I get compilation errors. The main error says '___stdcall
TEditXImpl::WMGetDlgCode(TMessage &)' is not a member of 'TEditXImpl'.
Again, sorry if I'm being a bit vague but this is very annoying to our users
and I'm sure it's fairly simple to fix. If you need any further specific
information please do not hesitate to ask.
Thanks,
Steve
"Timothy H. Buchman" <tbuchmanREMOVE(at)PLEASEcitycenter D O To r g>wrote
in message news:3fc2779a$ XXXX@XXXXX.COM ...
Quote
"Steve Fulleylove" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
I have inherited a C++ Builder 5 project (which I have now upgraded to
v6).
>This is an ActiveX control that derives from TEdit, adding a few
extra
>properties.
>
>However, the KeyDownEvent does not fire when the arrow keys are
used. It
>fires OK when all other keys are pressed. I have tried a standard
.exe
>project and the KeyDownEvent does fire for the arrow keys.

Steve, I take you at your word here. But I wonder if you mean a
*non-BCB* .exe? I don't write Active X's, but I don't think that's
the source of your problem. Please read this reference and let us
know if it is of any help! I'm not being un-gentle, but if you post
again, be sure to clearly describe what the project does with the
keystrokes. Does it override a TEdit method, use the exposed
OnKeyDown property (a pointer to a function), or what?

www.bcbdev.com/faqs/faq78.htm

--
Timothy H. Buchman
========================================
City Center Theater, New York NY
mail address tbuchmanPLEASE(at sign)REMOVEcitycenterD O Torg
Search .borland message archive on www.tamaracka.com/search.htm

 

{smallsort}