Keydown on load

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Hi all,

Has anyone got any idea on how to detect if the user is holding down a
key when a program starts? I have tried dealing with the forms
keypress event but to now avail... i have tried all key events.

All i want is for when the application starts, if the user is holding
down a key, it loads up the program with different values set...

Any ideas?

Dave
 
Dave said:
Hi all,

Has anyone got any idea on how to detect if the user is holding down
a key when a program starts? I have tried dealing with the forms
keypress event but to now avail... i have tried all key events.

All i want is for when the application starts, if the user is
holding down a key, it loads up the program with different values
set...

Any ideas?


If Alt, Ctrl, Shift is sufficient, you can use the shared property
Control.ModifierKeys. Otherwise use the GetKeyState or GetAsyncKeyState API
function.


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top