-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMouseWheelTabScroll4Chrome.ahk
52 lines (41 loc) · 1.46 KB
/
MouseWheelTabScroll4Chrome.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
; Mouse Wheel Tab Scroll 4 Chrome
; -------------------------------
; Scroll though Chrome tabs with your mouse wheel when hovering over the tab bar.
; If the Chrome window is inactive when starting to scroll, it will be activated.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
#SingleInstance force ; Determines whether a script is allowed to run again when it is already running.
#UseHook Off ; Using the keyboard hook is usually preferred for hotkeys - but here we only need the mouse hook.
#InstallMouseHook
#MaxHotkeysPerInterval 1000 ; Avoids warning messages for high speed wheel users.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
Menu, Tray, Tip, Mousewheel tab scroll for Chrome (1.0.3)
WheelUp::
WheelDown::
;CoordMode, Mouse, Window
MouseGetPos,, ypos, id
WinGetClass, class, ahk_id %id%
;WinGet, maximized, MinMax, %id%
;WinGetPos, wX, wY, , , A
;CoordMode, Mouse, Screen
;MouseGetPos,, MousescreenY, id
;ToolTip, ypos: %ypos% mY: %MousescreenY% wY: %wY% %id% %class%
If (ypos < 60 and (InStr(class,"Chrome_WidgetWin") or InStr(class,"Progman")))
{
;if (maximized)
;WinActivate ahk_id %id%
IfWinNotActive ahk_id %id%
WinActivate ahk_id %id%
If A_ThisHotkey = WheelUp
Send ^{PgUp}
Else
Send ^{PgDn}
}
Else
{
If A_ThisHotkey = WheelUp
Send {WheelUp}
Else
Send {WheelDown}
}
Return