Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 294
  • Last Modified:

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;
 i=1;
 i++;
 if (Key == VK_ESCAPE)
 {
  Continue=false;
  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.
Sotiris.
0
sotiris_zegiannis
Asked:
sotiris_zegiannis
1 Solution
 
cookreCommented:
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?
0
 
WelkinMazeCommented:
Hi,
are you sure VK_ESCAPE is the right thing to check?
0
 
InteractiveMindCommented:
To see if WelkinMaze is correct, comment out this line:

 if (Key == VK_ESCAPE)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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.
0
 
sotiris_zegiannisAuthor Commented:
I would like a refund.I answered my own question.
Thanks.
0
 
InteractiveMindCommented:
Post a request in the Community Support:
http:/Community_Support/
0
 
CetusMODCommented:
PAQed with points refunded (500)

CetusMOD
Community Support Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now