Application Does not Respond to keyboard input.!!!!

HEllo every body.I 've written an application that uses many forms in the main form and i now wish to add some keyboard  interactivity to it.look below:

void __fastcall TForm1::keypressed(TObject *Sender, char &Key)
 int i;
 if (Key == VK_ESCAPE)
  RichEditStatus->Text=RichEditStatus->Text+"........Unexpected Termination\n";

This is supposed to be the code to catch the keyboard events of my main form.THe thing is that if i press any button my application does not enter the function.Very strange behaviour.I would appreciate any help-notes on the matter.Thanks in advance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Presuming you've put in a msgbox to verify that routine is never entered, the most common cause is not properly identifying  the routine as the key handler. Should it have been keyPressed?
are you sure VK_ESCAPE is the right thing to check?
To see if WelkinMaze is correct, comment out this line:

 if (Key == VK_ESCAPE)
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

sotiris_zegiannisAuthor Commented:
I solved the mistery.I had to turn to true the keypreview attribute of the main form.After that it worked just fine.When this attribute is set to true it redirects all messages to the main form.THanks for the help anyway.
sotiris_zegiannisAuthor Commented:
I would like a refund.I answered my own question.
Post a request in the Community Support:
PAQed with points refunded (500)

Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.