AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ControlClick malfunction

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
alza68



Joined: 13 Nov 2008
Posts: 51

PostPosted: Sun Aug 02, 2009 8:19 pm    Post subject: ControlClick malfunction Reply with quote

Hello!
I had employed the script ControlClick for several programs on my computer and was functioning efficiently till lately wherein the application to a new script does not execute the command Instead it merely render the concerned button prominet by enlighting the button with interrupted lines It does not click the button I am unaware why this malfunction had developed and require your guidence to surmount this hassle
Regards,
alza68.
Back to top
View user's profile Send private message
kizsleg



Joined: 26 Jan 2009
Posts: 32

PostPosted: Mon Aug 03, 2009 1:43 am    Post subject: Reply with quote

can you post your code..lets try to debug it..
Back to top
View user's profile Send private message
bqw371



Joined: 26 Nov 2008
Posts: 32

PostPosted: Mon Aug 03, 2009 5:50 am    Post subject: Reply with quote

Sinkfaze has suggested a possible workaround to your problem in the past.
http://www.autohotkey.com/forum/viewtopic.php?t=44022
Back to top
View user's profile Send private message
alza68



Joined: 13 Nov 2008
Posts: 51

PostPosted: Mon Aug 03, 2009 10:02 am    Post subject: To Kiszleg Reply with quote

Run,C:\WINDOWS\system32\calc.exe
#IfWinActive,Calculator
ControlClick,5,Calculator
return

This is a simple a simple script with nothing complicated but there is no response whatsoever Now none of the script function with ControlClick Earlier scripts function alright
Regards,
alza68.
Back to top
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Mon Aug 03, 2009 10:04 am    Post subject: Reply with quote

You are probably want to use WinWaitActive and not #IfWinActive the #IfWinActive is for hotkeys and such as you don't have them in your example
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
alza68



Joined: 13 Nov 2008
Posts: 51

PostPosted: Mon Aug 03, 2009 10:36 am    Post subject: Thank you very much. HugoV Reply with quote

My sincere gratitude for correcting me, I was wondering would this be specific for calculator window or for all windows Since I prefer this function merely for calculator window hence I used this particualr command #IfWinExist Please guide me on this
Regards,
alza68.
Back to top
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Mon Aug 03, 2009 10:44 am    Post subject: Reply with quote

Code:
Run,C:\WINDOWS\system32\calc.exe
WinWaitActive, Calculator ; this will give the program the time to start up and "halt" the script before sending the ControlClick below
ControlClick,5,Calculator
return


Read the docs to understand the difference: (Note #If and If ARE different)
http://www.autohotkey.com/docs/commands/IfWinActive.htm
http://www.autohotkey.com/docs/commands/IfWinExist.htm
http://www.autohotkey.com/docs/commands/_IfWinActive.htm
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
alza68



Joined: 13 Nov 2008
Posts: 51

PostPosted: Mon Aug 03, 2009 11:21 am    Post subject: I have another script with control click To HugoV Reply with quote

Please correct me on this script this does not function too on when I intend to press certain buttons
IfWinExist,History alza68
{
#IfWinActive www.isc.ro
,::ControlClick,<,www.isc.ro,,Left,1
.::ControlClick,>,www.isc.ro,,Left,1
!,::ControlClick,<<,www.isc.ro,,Left,1
!.::ControlClick,>>,www.isc.ro,,Left,1
IfWinNotExist,Hstory alza68
Return
}
Return
Remember This requires two windows to present to execute the script The first window is a must "History alza68"
The second window is where the shortcut keys is to be executed "wwwisoro"
The Two windows are quoted
Back to top
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Mon Aug 03, 2009 1:26 pm    Post subject: Reply with quote

I don't understand the why you would need IfWinExist,History alza68 at all, if you simply use this
Code:
#IfWinActive www.isc.ro
,::ControlClick,<,www.isc.ro,,Left,1
.::ControlClick,>,www.isc.ro,,Left,1
!,::ControlClick,<<,www.isc.ro,,Left,1
!.::ControlClick,>>,www.isc.ro,,Left,1
Return
It should already work for this specific window only, why add the extra check? Again you seem to be misunderstanding the various IfWin... #IfWin. Read the docs again, it is very clear if study the examples.
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
alza68



Joined: 13 Nov 2008
Posts: 51

PostPosted: Mon Aug 03, 2009 1:49 pm    Post subject: I am afraid I tried your script but futile Reply with quote

To Hugov
I have tried your script It merely hilights the button momentarily but does not click the button.I am back to square one. oh! by the way You had asked me why I wanted to use the window " History alza68" since I tried to use click instead and found that if under ordinary circumstances that is without the window "History alza68" would click different button and led me to several disasters.
Although you had corrected the script and i did execute it, but does not fuction and it like as I had stated in the begining. the Buttons are highlighted momentarily without the expected click. Please guide me on this issue.
Regards,
alza68.
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Aug 03, 2009 2:20 pm    Post subject: Reply with quote

Quote:
Reliability

To improve reliability -- especially during times when the user is physically moving the mouse during the ControlClick -- one or both of the following may help:

1) Use SetControlDelay -1 prior to ControlClick. This avoids holding the mouse button down during the click, which in turn reduces interference from the user's physical movement of the mouse.

2) Specify the string NA anywhere in the sixth parameter (Options) as shown below:

SetControlDelay -1
ControlClick, Toolbar321, WinTitle,,,, NA

"NA" avoids marking the target window as active and avoids merging its input processing with that of the script, which may prevent physical movement of the mouse from interfering (but usually only when the target window is not active). However, this method might not work for all types of windows and controls.
Remarks
As implied in the above quote, not all windows will respone the same way to ControlClick. Some windows may require the use of a combination of the other options for ControlClick. Sometimes you must just determine what works by trial and error. (and unforunately there are some window controls that will just not respond).
Back to top
alza68



Joined: 13 Nov 2008
Posts: 51

PostPosted: Mon Aug 03, 2009 4:27 pm    Post subject: Unsuccessful yet! Reply with quote

Hello! Guest
I am afraid none of these tips or hints turned successful.I did configure SetcontrolDelay to -1 and NA as the sixth option in the ControlClick.It does highlight the button momentarily but does not click as expected. I find that quite strange. Its rather annoying a handy and well directed command is very unreliable at the most indispensilbe circumstances. Any other method to correct this mishap is always welcome.
Regards,
alza68.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group