I am trying to work with controlclick but I seem to be doing something very wrong or it doesnt work as intended I dont know.
the situation:
I have this ahk code:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
a::
Toggle := !Toggle
While Toggle{
Sleep 100
SetControlDelay -1
ControlClick,x974 y249,French Roulette im Real-Modus spielen | 5Gringos Casino - Google Chrome,,,,na pos
Sleep 100
}
return
now I checked controclick working beforehand by msgboxing the errorlevel wich is 0.
but still it didnt click where I wanted it.
I tried the same with a simple click command isntead (no coordinates, jsut clicking wherever the mosue is) and it worked.
however controlclick didnt seem to do the click in the intended place, despite having no obvious error.
now by mere accident I moved the mouse physically over the roulette table.
and weirdly enough my controlclick script above actually periodically does clicks at the mouse position which makes zero sense!
what's even more obscure:
while the clicks are registered when over a number field (like when you click on the "0" to place a chip on that number), the click is registered.
however when using the buttons below, like the one to cycle through the chip sizes and such, it doesnt work.
so first off and weirdly enough isntead of clicking at the given coordinates, it clicks at the current mouse position.
it also activates the window and brings it to the foreground (which is totally opposite to the very reason why I used controlclick. I wanted stuff to work in the background )
and secondly, after a bit of observation, I realized that the number field (where the click is registered) already count the click when the down event is triggered.
which I could also confirm physically, as after pressing down the mouse, the chip was already placed on the field, even before releasing the mosue again.
however the buttons where the clicking doesnt work wait for both the down and up event.
and for some reason, the up event is not registered there properly.
so i can visually see that the button is pressed down but doesnt get released again (or at least it aint recognized as such. which would be needed as only down+up event count as a click there)
long story short the up event of the control click doesnt seem to get recognized there and I dont know why.
any idea what i could do about the mentioned issues?
but the up event issue as well as the fact that controlclickw weirdly acts as if it was the simple click event instead?