Home All Groups Group Topic Archive Search About
Author
26 Jan 2006 12:06 PM
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

Author
26 Jan 2006 12:18 PM
Armin Zingler
"Dave" <davesa***@gmail.com> schrieb
> 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
Author
26 Jan 2006 1:15 PM
Dave
thats brilliant thank you, I knew it was something like that!