私は2つの異なるウィンドウ用のスクリプトを作成しています。最初のウィンドウをクリックすると、別のウィンドウの同じ位置にあるクリックが発生します。オートハットキーによるマウスコントロール
問題がある、私のスクリプトは、第二のウィンドウをクリックけど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