Hello, just started learning ahk and found out not much tutorials exist on the web about it. Anyway I'm trying to write a code that will connect between 2 windows so if I click with the mouse in 1 game window it will click in the other game window in the same place aswel (same for left and right mouse click)

Been trying to work with both those codes but it got messy and nothing worked and I'm not even sure I'm doing the right thing here.
Code:
KeyWait, LButton, D
~LButton:: 
ControlSend,, {LButton}, ahk_id %active_id%
Return


MouseGetPos xpos, ypos
Click::ControlSend, , {MouseClick, left, xpos, ypos}, ahk_pid %active_id%
Would be glad to get some assistance to get my project running.
Thanks in advance.