Window click not working #254
-
I'm not sure if its the click that is not working or its the coordinates because I saw another discussion and the answer was that it clicks based on the window not the screen coordinates if thats the issue how can I get the coordinates from the window. Thanks Here is my code which is a test for the library:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The
If the window you're interacting with is in the foreground, you may find using By default, From the examples in the README: ahk.mouse_position # Returns a tuple of mouse coordinates (x, y) (relative to active window)
ahk.get_mouse_position(coord_mode='Screen') # get coordinates relative to the screen
ahk.click(200, 200) # Moves the mouse to a particular position and clicks (relative to active window)
ahk.click(100, 200, coord_mode='Screen') # click relative to the screen instead of active window Does that help answer your question? |
Beta Was this translation helpful? Give feedback.
The
Window.click
method uses ControlClick under the hood. So, it obeys the relative positioning considerations mentioned in the docs there. That is:If the window you're interacting with is in the foreground, you may find using
ahk.click
easier if you want to use coordinates relative to the screen rather than the window.By default,
.get_mouse_position()
(or.mouse_position
) will retrieve coordinates relative to the active window. This is also the default behavior forahk.click
(which uses Click) but you can set the coordinate mode to change this behavior.From the ex…