Jump to content

Can BlockInput() persist after exiting?


Recommended Posts

Is there a way for the BlockInput() function to persist after the script exits? For example, another macro tool would run an AutoIt executable consisting of BlockInput(1), then the other program would do stuff, and finally it would release control by running another AutoIt executable consisting of BlockInput(0). So far I have been unsuccessful because after the first executable exits the blocking functionality ends.

By the way, it's nice that BlockInput() doesn't seem to affect other macro tools which can move the mouse (e.g. StrokeIt),...although it does seem to prevent the other tool from entering keystrokes.

Thank you in advance

Edited by drdrey
Link to comment
Share on other sites

I believe that the blocking functionality ends when the script does. Couldn't you just include a BlockInput(1) in the second script as well?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

The issue is the interaction between the external macro tool (StrokeIt) and the AutoIt executable. StrokeIt does not accept feedback and once I turn on BlockInput(1) neither will the AutoIt executable. In such a case, how does the AutoIt executable know when to deactivate BlockInput()? Since the mouse does not appear to be affected, the only roundabout way I can think of is for the AutoIt script to look for a particular mouse position that StrokeIt will go to as a signal to exit.

Link to comment
Share on other sites

Do you absolutely need to use StrokeIt or can whatever it's doing be done with a pure AutoIt script? I'm not overly familiar with the program but it seems like you could probably use AI to do whatever is being done.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

I use StrokeIt quite a bit as it couples mouse gesture recognition with extreme user friendliness for simple macros. I've attached an AutoIt script that I plan to use as described above (whereby the mouse location signals an end for BlockInput()), but if anyone has a more elegant method I'd be happy to hear about it.

Note: From quick experimentation using "absolute screen coordinates," for some reason StrokeIt and AutoIt do not agree on the mouse location near the origin. So even though (0,0) works, something like (1, 1) set by StrokeIt still looks like (0,0) to AutoIt as viewed from AU3Info. Higher values (e.g. (101,201)) seem to agree.

BlockUserInput.au3

Edited by drdrey
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...