• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 387
  • Last Modified:

KeyCode

Is there a way to find the KeyCode when we don't know where is the focus. I don't want to use SetFocus. I just want to catch the KeyCode Anytime.
If it is possible without Api i'd like?
0
dosyl
Asked:
dosyl
  • 3
  • 2
1 Solution
 
Sage020999Commented:
Are you talking about monitoring which keys are pressed in your app?  You can turn on the keypreview for the form.  
0
 
dosylAuthor Commented:
I want to verify for example:
If the user press Delete, i will delete the info. on the form. Etc.
0
 
dosylAuthor Commented:
Info.= Data in txtboxes, data in the recordset etc.
0
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.

 
Sage020999Commented:
Ok,  turn on your keypreview for the form.  This will send the keypreview property of the form.  This will force the keys to affect the form and not the controls on the form.  You can then validate the keys in the Keyup or Keydown events to involk the differant responses you wish to create.
0
 
korkyCommented:
Use the GetAsyncKeyState() API


0
 
dosylAuthor Commented:
I forgot this property.
Thank you.
0
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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