Code: Select all
~WheelDown::
MouseGetPos,,, hwnd
WinActivate, ahk_id %hwnd%
return
[Mod edit: Mpved topic to AHK v1 help, since this is not v2 code.]
Code: Select all
~WheelDown::
MouseGetPos,,, hwnd
WinActivate, ahk_id %hwnd%
return
The $ prefix has no effect for mouse hotkeys, since they always use the mouse hook. It also has no effect for hotkeys which already require the keyboard hook, including any keyboard hotkeys with the tilde (~) or wildcard (*) modifiers, key-up hotkeys and custom combinations. To determine whether a particular hotkey uses the keyboard hook, use ListHotkeys.
Code: Select all
WheelDown::
MouseGetPos,,, hwnd
WinActivate, ahk_id %hwnd%
Send, {WheelDown}
return
Code: Select all
#ifWinActive ahk_exe soffice.bin
WheelDown::
Send, {PgDn}
return
Code: Select all
#Requires AutoHotkey v1.1.33
WheelDown:: ; Not LibreOffice
MouseGetPos,,, hWnd
WinActivate % "ahk_id" hWnd
Send {WheelDown}
SoundBeep 1500
Return
#If WinActive("ahk_exe soffice.bin") ; LibreOffice
WheelDown::Send {PgDn}
#If
Code: Select all
#Requires AutoHotkey v1.1.33
WheelDown:: ; Not LibreOffice
MouseGetPos,,, hWnd
WinActivate % "ahk_id" hWnd
Send {WheelDown}
SoundBeep 1500
Return
#If WinActive("ahk_exe soffice.bin") ; LibreOffice
WheelDown::Send {PgDn}
#If
Code: Select all
#Requires AutoHotkey v1.1.33
#If MouseIsOver("ahk_exe soffice.bin") ; LibreOffice
WheelDown::Send {PgDn}
#If
WheelDown:: ; Not LibreOffice
MouseGetPos,,, hWnd
WinActivate % "ahk_id" hWnd
Send {WheelDown}
SoundBeep 1500
Return
MouseIsOver(WinTitle) {
MouseGetPos,,, Win
return WinExist(WinTitle . " ahk_id " . Win)
}
Code: Select all
#Requires AutoHotkey v1.1.33
WheelDown::
MouseGetPos,,, hWnd
If !WinActive("ahk_id " hWnd) ; if the window under the cursor isn`t active ...
WinActivate, ahk_id %hWnd% ; ... activate
WinGet, ProcName, ProcessName, A ; get the process name of the active window
If (ProcName = "soffice.bin") ; if it is a LibreOffice window
Send {PgDn}
Else { ; otherwise
Send {WheelDown}
SoundBeep 1500
}
Return
Code: Select all
WheelDown::
MouseGetPos,,, hWnd
If !WinActive("ahk_id " hWnd) ; if the window under the cursor isn`t active ...
WinActivate, ahk_id %hWnd% ; ... activate
WinGet, ProcName, ProcessName, A ; get the process name of the active window
If (ProcName = "soffice.bin") ; if it is a LibreOffice window
Send {PgDn}
Else { ; otherwise
Send {WheelDown}
SoundBeep 1500
}
Return
Users browsing this forum: Descolada and 173 guests