Jump to content
Sign in to follow this  

Detect if Shift Key is pressed when script is started

Recommended Posts


I have tried searching forums for this but not having much luck. I have created a simple gui with 2 radio buttons. When the user selects a radio button and then clicks ok several ini files are replaced on their C drive and then an application is started using the run command. This allows the user to conect to a different database whenever they want. So far so good. However we also have a development environment and i would like only certain users to be able to select that option.

In a similar way to Microsoft Access i would like to hold the shift key down when the program is loaded and if this is detected then create a third radio button with the development ini files being copied to the machine.

I have looked at "_ispressed" function but can't find much info on how to use shift key

Any ideas on how i can do this or if there is a better way to achieve my goal.

Thanks in advance

Share this post

Link to post
Share on other sites


#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("10", $dll) Then
        MsgBox(0,"_IsPressed", "Shift Key Pressed")

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...