Jump to content
Sign in to follow this  
jdickens

Newbie Q: Way to tell if user clicked a window?

Recommended Posts

jdickens

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.

Share this post


Link to post
Share on other sites
jdickens

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.

Share this post


Link to post
Share on other sites
Insolence

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.

Share this post


Link to post
Share on other sites
CyberSlug

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 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!

Share this post


Link to post
Share on other sites
jdickens

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.

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  

×