以下のコードを実行していますが、コンマを押すと、マウスが現在アクティブなウィンドウの中央に移動することを期待しています。代わりに、ウィンドウが画面上のどこにあるかに応じて、画面上のさまざまなポイントに移動します。画面。ウィンドウが左上(x = 0、y = 0)に配置されている場合にのみ、マウスが適切に中央に配置されます。
#NoEnv
SendMode Input
#WinActivateForce
Sysget, Mon2, Monitor, 2
,::
WinGetActiveStats, Title, Width, Height, X, Y
{
MsgBox, The active window "%Title%" is %Width% wide`, %Height% tall`, and positioned at %X%`,%Y%.
;center_x:=X+(Width*.5)
;center_y:=Y+(Height*.5)
MouseMove, X+(Width*.5), Y+(Height*.5), 90
}
Return