Jump to content

More options for blocking input?


mikjay
 Share

Recommended Posts

I sincerely apologize if this has been answered. It's giving me a headache, and I know I'm so close to the answer I'm just not there yet!

I'd like to run my script without user interference. The script is largely mouse movement and keyboard input generated by the script. Blockinput() works like a charm, as it allows me to use send() and mousemove(), but of course blocks my exit hotkey. I looked pretty closely at the Blockinputex UDF in hopes that it would work, but I can't find a way to allow input from functions. The only solution I can think of is to unhook before using send or mousemove, and then rehook, which is very clunky and subject to interference. Does anybody have any ideas? Thanks a lot!

Link to comment
Share on other sites

I sincerely apologize if this has been answered. It's giving me a headache, and I know I'm so close to the answer I'm just not there yet!

I'd like to run my script without user interference. The script is largely mouse movement and keyboard input generated by the script. Blockinput() works like a charm, as it allows me to use send() and mousemove(), but of course blocks my exit hotkey. I looked pretty closely at the Blockinputex UDF in hopes that it would work, but I can't find a way to allow input from functions. The only solution I can think of is to unhook before using send or mousemove, and then rehook, which is very clunky and subject to interference. Does anybody have any ideas? Thanks a lot!

There's a minesweeper bot out there that uses BlockInput(), but checks to see if the task manager is opened and if it is than exit the script. BlockInput() doesn't block Ctrl+Alt+Del.

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Link to comment
Share on other sites

I understand the usage of Ctrl+Alt+Delete to unblock the keys, but I'd really not like to have the users have to press a key combination to exit. I'll ask when I present the program today if that is acceptable, what I was hoping for was a way to unhook the Esc key, while allowing input from the script.

Link to comment
Share on other sites

The hard way - set hotkeys to all the keyboard keys + Move the cursor to the bottom-right corner, something like this:

HotKeySet("a","doNothing")
HotKeySet("+{a}","doNothing")
HotKeySet("b","doNothing")
HotKeySet("c","doNothing")
HotKeySet("{ESC}","quit")

$x = @DesktopWidth
$y = @DesktopHeight

While 1
    MouseMove($x,$y,0)
    Sleep(10)
WEnd

Func doNothing()
    ;
EndFunc

Func quit()
    Exit
EndFunc

Hi ;)

Link to comment
Share on other sites

Thanks for all of your input!

I guess if the preferred method is to use controlclick and controlsend, I have a little different question. I'm working in a window that does not have any recognizable controls. It's a proprietary piece of software my company uses for inventory. WindowInfo never gives me anything other than coordinates and colors. I've been automating the software with just that ability, so I needed some way to prevent the user from bumping the mouse but still allowing my script to move the mouse. Is there a way to find the controls for this "uncontrollable" window?

Link to comment
Share on other sites

I sincerely apologize if this has been answered. It's giving me a headache, and I know I'm so close to the answer I'm just not there yet!

I'd like to run my script without user interference. The script is largely mouse movement and keyboard input generated by the script. Blockinput() works like a charm, as it allows me to use send() and mousemove(), but of course blocks my exit hotkey. I looked pretty closely at the Blockinputex UDF in hopes that it would work, but I can't find a way to allow input from functions. The only solution I can think of is to unhook before using send or mousemove, and then rehook, which is very clunky and subject to interference. Does anybody have any ideas? Thanks a lot!

I think this post by covaks would do what you want with some small mods.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...