jdickens Posted December 29, 2004 Share Posted December 29, 2004 Is there a way to initiate an AutoIt script response when a user clicks on some given window or hits enter when that window is active? newbie. [emoticon of baby] J If I am too verbose, just say so. You don't need to run on and on. Link to comment Share on other sites More sharing options...
Josbe Posted December 29, 2004 Share Posted December 29, 2004 Yeah. You can read about this: WinActive AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
jdickens Posted December 29, 2004 Author Share Posted December 29, 2004 Sorry, my question was put wrongly. I mean to find out if a user has hit a *control* in a window, or hit enter for the default control of the window. I want to trap inputs on a simple dialog and send them to another app which has a lousy interface. PS I am just coming across the GUI aspects of the beta AutoIt, and that will prob. be best to just make a new simple dialog. J If I am too verbose, just say so. You don't need to run on and on. Link to comment Share on other sites More sharing options...
Insolence Posted December 29, 2004 Share Posted December 29, 2004 You could do something kinda wacky and put a huge transparent GUI over the screen (can you do that?) and just get the X and Y of each click and send that to the other app? "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
CyberSlug Posted December 30, 2004 Share Posted December 30, 2004 (edited) For trapping mouse, you can try the code in http://www.autoitscript.com/fileman/users/public/CyberSlug/autowriter.zip. It uses a hidden GUI with the magic of GuiGetCursorInfo to trap mouse clicks, and it supports rudimentary support for detecting button clicks..... It generates an output file on the Desktop....Maybe something like this for trapping Enter:HotKeySet("{Enter}", "TrapEnter") While 1 sleep(10) Wend Func TrapEnter() If WinActive("nameOfWindow") Then ; do stuff Else;act as if Enter was not trapped HotKeySet("{Enter}");unregister hotkey Send("{Enter}") HotKeySet("{Enter}", "TrapEnter");re-register EndIf EndFunc Edited December 30, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jdickens Posted December 30, 2004 Author Share Posted December 30, 2004 That's clever. (But not in a counter-intuitive way) I like that. I have not looked at AutoWriter yet. Thanks J If I am too verbose, just say so. You don't need to run on and on. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now