Jump to content

BlockInput Question


Recommended Posts

Hi All

I have trawled the forums and cannot seem to find a definitive answer to my question.

I would like to use the BlockInput function to prevent users easily disrupting certain applications which are being deployed by limiting access via mouse / keyboard. I have created a .exe containing the following code:

BlockInput(1)

I want to run this and then deploy an application and then run the BlockInput(0) function to turn keyboard/ mouse input back on...however, this does not work.

I can get the following to work perfectly:

BlockInput(1)

"run some file or do something"

BlockInput(0)

Is it possible to run just the BlockInput(1) statement and have input suspended indefinitely (besides the Crtl, Alt, Del etc.), or have I misunderstood the documentation?

Many thanks

Arthur

Link to comment
Share on other sites

Hi All

I have trawled the forums and cannot seem to find a definitive answer to my question.

I would like to use the BlockInput function to prevent users easily disrupting certain applications which are being deployed by limiting access via mouse / keyboard. I have created a .exe containing the following code:

BlockInput(1)

I want to run this and then deploy an application and then run the BlockInput(0) function to turn keyboard/ mouse input back on...however, this does not work.

I can get the following to work perfectly:

BlockInput(1)

"run some file or do something"

BlockInput(0)

Is it possible to run just the BlockInput(1) statement and have input suspended indefinitely (besides the Crtl, Alt, Del etc.), or have I misunderstood the documentation?

Many thanks

Arthur

It sounds like you are doing BlockInput(1) and exiting the script, expecting the block to remain.

The script that is doing the blocking must continue to run to maintain the block. Put the blocking script in a loop that will exit on some flag indicating when it should be released, like a file, registry entry, GUI action, etc.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

It sounds like you are doing BlockInput(1) and exiting the script, expecting the block to remain.

The script that is doing the blocking must continue to run to maintain the block. Put the blocking script in a loop that will exit on some flag indicating when it should be released, like a file, registry entry, GUI action, etc.

:)

AH! That makes sense now - many thanks for the reply

ARthur

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...