Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I catch keyboard input?

Status
Not open for further replies.

bball1525

Programmer
Joined
Sep 15, 2003
Messages
4
Location
US
I am writing a program in vba for autocad but i am having a problem. When my userform is modal, which it must be to access the autocad interface, I can't use my keydown and keyup events. Is there any way that I can have my userform respond to keyboard inputs (primarily "shift" and "ctrl") while it is modal, or check to see if these buttons are being pressed at a given time while my userform is modal. Any help or suggestions would be greatly appreciated.
 
Hi,
I don't know buttons about autocad, but in Access/Word/Excel, if you set the KeyPreview property of the form, I think you can respond to key events whether or not the form is modal. I don't think that even then, you will be able to "respond" to keys like shift/alt/ctrl though. The only thing you can do with these is, when another key is pressed, you can see if one of them was down at the same time.

Hope this helps.

Tranman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top