Capture Shift Held Down When Application Starts?

A

Alex Stevens

Hi All,

I'm writing a launcher program which checks for updates and copies them down
to the client.
However, I would like the user to be able to modify the settings for the
launcher. As this runs automatically, I would like it to be configurable by
the user holding down the shift key when double-clicking my exe, to bypass
the usual update routine and start the config form.

Access does something similar, by holding down the shift to bypass the
autoexec macros with automatically starts on startup.

I'm already checking for command parameters to start the config, but that
isn't acceptable, and the user would have to modify the shortcut etc.

Any ideas?

Thanks

Alex
 
G

Guest

Alex Stevens said:
Hi All,

I'm writing a launcher program which checks for updates and copies them down
to the client.
However, I would like the user to be able to modify the settings for the
launcher. As this runs automatically, I would like it to be configurable by
the user holding down the shift key when double-clicking my exe, to bypass
the usual update routine and start the config form.

Access does something similar, by holding down the shift to bypass the
autoexec macros with automatically starts on startup.

I'm already checking for command parameters to start the config, but that
isn't acceptable, and the user would have to modify the shortcut etc.

Any ideas?

Thanks

Alex
 
S

Samuel R. Neff

If Control.ModifierKeys = Keys.Shift Then
' Shift is being held down.. special processing...
End If

This checks if Shift is the only modifier key being pressed. If you
want to check if shift or any other key is pressed, then use

If (Control.ModifierKeys And Keys.Shift) = Keys.Shift Then
' Shift is being held down.. special processing...
End If

HTH,

Sam


B-Line is now hiring one VB.NET developer for
WinForms + WebServices position with ASPX in future.
Seaking mid to senior level developer. For
information or to apply e-mail sam_blinex_com.
 

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

Top