My code below isn't producing the expected result, and my hunch is that it's an error with the coordinates possibly. Does anyone see an issue with the code?
Code: Select all
;-----------------------------------------------------------
; Mouse Broadcasting Hotkeys
;-----------------------------------------------------------
~XButton1::
BroadcastMouse(A_ThisHotkey)
Return
;-----------------------------------------------------------
; Mouse Broadcast Function
;-----------------------------------------------------------
BroadcastMouse(mouseKey)
{
WinGetTitle, thisWindow
MouseGetPos, xCoordinate, yCoordinate
; This step is converting my raw hotkey input into a form that is recognizable by the ControlClick parameters
If InStr(mouseKey, "~XButton1") {
mouseKey = X1
}
ControlClick,,WinTitle,,%mouseKey%,, x%xCoordinate% y%yCoordinate%
; Return my mouse and window focus to my orignal window (the window in which I first pressed XButton1)
WinActivate, thisWindow
MouseMove, xCoordinate, yCoordinate
}
Return