I use autohotkey to perform a ctrl+home combo when I press my middle mouse button, with the result of jumping to the top of the webpage I'm on. This, however, breaks down if the cursor is inside a text input box, since ctrl+home in this case merely takes the cursor to the beginning of the input box.
Performing a tab before the ctrl+home can work sometimes, but not always, since the cursor could simply move to another input box. Pressing alt removes the cursor from the input box, but afterwards the ctrl+home won't work.
My goal is to be able to reliably jump to the top of any webpage.
My script at the moment is:
MButton::
SendInput ^{home}
return
;