Jump to content
Sign in to follow this  
mikjay

More options for blocking input?

Recommended Posts

mikjay

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!

Share this post


Link to post
Share on other sites
Minikori

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

Share this post


Link to post
Share on other sites
mikjay

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.

Share this post


Link to post
Share on other sites
Richard Robertson

BlockInput is for blocking ALL user input. It's built in to Windows which is why it can't really be customized. There is no simple way to block keystrokes and mouse input.

This is why we have functions like ControlClick and ControlSend.

Edited by Richard Robertson

Share this post


Link to post
Share on other sites
Mison

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 ;)

Share this post


Link to post
Share on other sites
Mison

Wahaha... I'm using XP, I never knew this will happen... ;) thought it's the best place to hide the cursor..

ermm.. move your cursor elsewhere then

OT:Windows 7 is soooo seductive... :)


Hi ;)

Share this post


Link to post
Share on other sites
mikjay

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?

Share this post


Link to post
Share on other sites
Richard Robertson

You can use the window handle and no control handle I believe, to send clicks to some location on the window. Just specify the X,Y to click. At least I think that it works that way...

Share this post


Link to post
Share on other sites
martin

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.

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  

×