20 July, 2013

Useful AutoHotkey scripts

Scroll "Page up" or "Page down" with left mouse button and mouse wheel in Opera or  Firefox



Press and hold the left mouse button and turn the mouse wheel up or down.

#IfWinActive ahk_class OperaWindowClass ; inside Opera
~LButton & WheelUp:: SendInput {PgUp}
~LButton & Wheeldown:: SendInput {PgDn}
#IfWinActive
          #IfWinActive ahk_class MozillaWindowClass  ; inside Firefox
         ~LButton & WheelUp:: SendInput {PgUp}
         ~LButton & Wheeldown:: SendInput {PgDn}
          #IfWinActive







         #IfWinActive ahk_class WordPadClass  ; inside  WordPad

         ~LButton & WheelUp:: Gosub, PageUp ; 
         ~LButton & Wheeldown:: Gosub, PageDown

         PageDown:
         SendMessage, 0x115, 3, 0, RICHEDIT50W1, ahk_class WordPadClass ; scroll PageDown
         return

         PageUp:
         SendMessage, 0x115, 2, 0, RICHEDIT50W1, ahk_class WordPadClass ; scroll PageDown
         return

         #IfWinActive







Or another way: scroll with middle mouse button pressed and held down plus mouse wheel up/down

~MButton & WheelUp:: SendInput {PgUp}
~MButton & Wheeldown:: SendInput {PgDn}

/I would prefer to use the right click and wheel, but the "tab switch" feature with "right click + mouse wheel" can't be disabled in Opera/

••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••


Double click in Windows Photo Viewer to toggle "Actual size" and "Fit to Window".

Double click on picture inside Windows Photo Viewer.

#IfWinActive ahk_class Photo_Lightweight_Viewer
~LButton::
MouseGetPos,X,Y,, control
if(A_PriorHotkey = "~LButton" AND A_TimeSincePriorHotkey < 400 AND control == "Photos_PhotoCanvas1"){
;ControlClick, Photos_ButtonEx21
ControlGet, info_panel, Visible, , Photos_ButtonEx40, ahk_class Photo_Lightweight_Viewer ; if info panel
if(info_panel){
ControlClick, Photos_ButtonEx34
}else{
ControlClick, Photos_ButtonEx21
}
}
return
#IfWinActive



Adjust volume by scrolling the mouse wheel over the taskbar (from AutoHotkey help)



#If MouseIsOver("ahk_class Shell_TrayWnd")
WheelUp::Send {Volume_Up}
WheelDown::Send {Volume_Down}
MouseIsOver(WinTitle) {
MouseGetPos,,, Win
return WinExist(WinTitle . " ahk_id " . Win)
}
#If

No comments:

Post a Comment