====== Simulating a Mouse Click ======

function director:OnPlayerFound(player)
--Once the player is found simulate a mouse click at coordinates x, y. The window handle for the
--player is passed to this function in player
Mouse.SimulateClick(player, xCoordinate, yCoordinate)

Use the director property director:get_BrowserWindow() to return the handle of the browser window.

function director:GetPlayerViewingRectangle(playerSize)
--Can be used in any function within the Director block
browserhWnd = director:get_BrowserWindow()
Mouse.SimulateClick(browserhWnd, xCoordinate, yCoordinate)

--You can also click in the player window using a director property
playerhWnd = director:get_PlayerWindow()
Mouse.SimulateClick(playerhWnd, xCoordinate, yCoordinate)

return Rectangle(0, 0, playerSize.Width, playerSize.Height);


See Also: [[Mouse Move]], [[Director Properties]]