Why is my control click not working?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
TeddySpaghetti
Posts: 5
Joined: 24 Jul 2020, 17:40

Why is my control click not working?

24 Jul 2020, 18:04

Hi, sorry if this is not the place to post this but im quite new to AHK and could really use some help. Could someone please tell me why my code is not working?

Code: Select all

F3::
ControlClick, X55 Y41, EXP Soundboard vers. 0.5 | ,,,, Pos
Return

F5::
ControlClick, File, soundboardscript.ahk - Notepad
Return
Im trying to get it to click on a box inside exp soundboard but nothing happens.
User avatar
boiler
Posts: 17399
Joined: 21 Dec 2014, 02:44

Re: Why is my control click not working?

24 Jul 2020, 19:21

It doesn’t look like a y value of 41 would even get below the menu bar of the app. How did you get those coordinates? They are supposed to be relative to the window’s upper-left corner, not relative to the window’s client area.
TeddySpaghetti
Posts: 5
Joined: 24 Jul 2020, 17:40

Re: Why is my control click not working?

24 Jul 2020, 21:12

I got the coords with the following code

Code: Select all

F4::
MouseGetPos, xpos, ypos 
MsgBox, The cursor is at X%xpos% Y%ypos%.
User avatar
boiler
Posts: 17399
Joined: 21 Dec 2014, 02:44

Re: Why is my control click not working?

24 Jul 2020, 21:48

If you’re confident in the coordinates, then I would try running the script as administrator. Some windows just don’t respond to ControlClick, however, and it’s possible that this is one of those. You might try a regular Click with that window being active to see if it works that way.
Pepineros
Posts: 45
Joined: 16 Apr 2018, 17:26
Location: Ireland

Re: Why is my control click not working?

25 Jul 2020, 00:46

Try it with a mousemove to the coordinates you're using, and a regular click (not controlclick) to see if your coords are good. Obviously the target window needs to be active for this.

If it turns out that the coords were wrong, I recommend using windowSpy (built in to autohotkey) to find the coords you need.

Also make sure the title of your target window is valid and recognised correctly.

Controlclick can fail at multiple places without telling you anything.
TeddySpaghetti
Posts: 5
Joined: 24 Jul 2020, 17:40

Re: Why is my control click not working?

25 Jul 2020, 01:10

Hi pepeniros, thanks for the response. I tried using window spy but I dont see where I would get my mouse coordinates.
User avatar
boiler
Posts: 17399
Joined: 21 Dec 2014, 02:44

Re: Why is my control click not working?

25 Jul 2020, 01:13

TeddySpaghetti wrote:
25 Jul 2020, 01:10
Hi pepeniros, thanks for the response. I tried using window spy but I dont see where I would get my mouse coordinates.
In the section titled “Mouse Position:”
TeddySpaghetti
Posts: 5
Joined: 24 Jul 2020, 17:40

Re: Why is my control click not working?

25 Jul 2020, 01:17

I tried just using click but I'd like it to only work on my soundboard window. Also the click is clicking on my other monitor

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: apeironn, madensuyu1, peter_ahk and 352 guests