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
 
Back
Top