The following function will post a click to any window, without moving the mouse, without even activating if desired. window needn't even be on-screen! it is awesome, and I use it in almost all scripts.
Code:
;Juks rocks
PostLeftClick(x, y, table_id, activate=1) {
; ### JUK: Send the down left click, then the mouse-up messages.
; NOTE: This is relative to the top left of the client area and NOT the top left of the
; window (ie: It *doesn't* include the title-bar like AHK's MouseClick does!!!).
If activate
WinActivate, ahk_id%table_id%
PostMessage, 0x201, 0x0001, ((y<<16)^x), , ahk_id%table_id%
PostMessage, 0x202 , 0, ((y<<16)^x), , ahk_id%table_id%
}
unfortunately FTP used to be a bit buggy, not responding to such messages properly sometimes. this might have changed, so it's worth a try.
Otherwise your other thought is a good one. very common to a) save current mouse position. b) set mouse move speed to 0 (or whatever it is for instant/fastest, check AHK docs) c) blockinput on d) move, click, moveback e) blockinput off. This is mostly unnoticable, but postmessage is superior if it works.
to allow click events to "pass through" from an overridden hotkey, preceed the definition with a tilde.
e.g.
Code:
~RButton::
msgbox, the normal menu will appear after this popup
return
or you can do fancier stuff with IfWinActive, ir other method to identify the window e.g.
Code:
RButton::
if (is_a_poker_table)
{
do_custom_function()
}
else
{
Send, {RButton}
}
return