#GPT-4 Conversation #1101328090027790416
1 messages · Page 1 of 1 (latest)
I've written an AutoHotKey scripts to click on button in an open On-Screen Keyboard with the mouse, but the buttons aren't being clicked. How to solve?
To help you solve the issue, I need to understand your current AutoHotKey script. Can you please provide me with the portion of the script related to clicking on the On-Screen Keyboard buttons?
CoordMode, Mouse, Screen
F8::
mousemove , 813 ,1130
Send, {LButton Down}
Sleep, 1000
Send, {LButton Up}
Return
From your given script, it seems that you'd like to perform a left mouse button click at screen coordinates (813, 1130) when you press the F8 key. You might want to use the Click command instead of Send for more reliable mouse clicks. Try the following modification:
CoordMode, Mouse, Screen
F8::
MouseMove, 813, 1130
Sleep, 100 ; Optional: You can adjust this value or remove it entirely
Click down ; Press the left mouse button down
Sleep, 1000 ; Hold for 1 second (1000 ms)
Click up ; Release the left mouse button
Return
Try this script as-is, and adjust the coordinates if needed. If it still doesn't work, make sure the On-Screen Keyboard is in focus when you execute the script (click on it before pressing F8). Also, double-check that the script is running with administrator privileges. To do this, right-click on the AutoHotkey script file and select "Run as administrator."
solve this
It appears you provided the same AutoHotKey script as before. Based on your initial description and the provided script, I assume you want to click a button on the On-Screen Keyboard. Here's the revised script using the Click command for better click handling:
CoordMode, Mouse, Screen
F8::
MouseMove, 813, 1130
Sleep, 100 ; Optional: You can adjust this value or remove it entirely
Click down ; Press the left mouse button down
Sleep, 1000 ; Hold for 1 second (1000 ms)
Click up ; Release the left mouse button
Return
Before pressing F8, ensure that the On-Screen Keyboard is in focus (click on it). If it still doesn't work, confirm the script is running with administrator privileges. Right-click the AutoHotkey script file and select "Run as administrator."
Alternatively, you can try using ControlClick, which sends a click command directly to a control without needing window focus:
F8::
ControlClick, x813 y1130, ahk_class OskMainFrame
Return
Please replace the ahk_class with the appropriate window class for the On-Screen Keyboard you're using. To find the class, use Window Spy, which comes with AutoHotkey.
If you continue to experience challenges, consider providing more context or clarification so I can better address your concerns.
Duplicate this line a number of items, incrementing 85 to 86, 87, .. etc. and 14/1 to 21/1, 28/1, 4/2, .. etc. Note: The year is not a leap year. Stop at 100.
Manga & Anime - 14/1 - Webtoon - The Ember Knight 85