Я делаю скрипт для двух разных окон, и когда я нажимаю на первое окно, происходит щелчок в той же позиции в другом окне.
Проблема в том, что мой скрипт выполняет клик, но ось x
во втором окне всегда 0
... и я не знаю, почему
Может быть, у вас есть решение или другой способ написания сценария?
Это мой сценарий:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Recommended for catching common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;retrouver les id de 2 fenetres
WinGet, first_id, ID, window1
WinGet, sec_id, ID, window2
;activation des fenetres
WinActivate, ahk_id %sec_id%
WinActivate, ahk_id %first_id%
; fonction pour quitter la macro
~Esc::ExitApp
return
;test repeter clic souris
;LeftClic
~LButton::
{
MouseGetPos, xposi, yposi
ControlClick, x%xposi% y%yposi%, ahk_id %first_id%,,LEFT
WinActivate, ahk_id %sec_id%
ControlClick, x%xposi% y%yposi%, ahk_id %sec_id%,,LEFT
WinActivate, ahk_id %first_id%
MouseMove, xposi, yposi
}
return