@Krusdy
Hello
I made a small script that lets you use sustained right-click + wheel scroll to switch between tabs.
#Requires AutoHotkey v2.0
#SingleInstance Force
; Opera, right mouse button:
; - short click: normal right click (context menu)
; - press + mouse move: gesture (Opera only receives the press once the movement starts)
; - hold for 0.8 s without moving: Ctrl+Tab (Ctrl stays held down),
; then wheel down = Right arrow, wheel up = Left arrow;
; when you release the right button, Ctrl is released.
; ---------- SETTINGS ----------
; How many milliseconds the right button must be held:
holdMs := 800
; Mouse movement (in pixels) beyond which the action counts as a gesture:
gestureThreshold := 6
; ------------------------------
active := false
OnExit(ReleaseCtrl)
#HotIf WinActive("ahk_exe opera.exe")
RButton:: {
global active
MouseGetPos &x0, &y0
startTime := A_TickCount
Loop {
if !GetKeyState("RButton", "P") {
Click "Right"
return
}
MouseGetPos &x1, &y1
if (Abs(x1 - x0) > gestureThreshold || Abs(y1 - y0) > gestureThreshold) {
Send "{RButton down}"
KeyWait "RButton"
Send "{RButton up}"
return
}
if (A_TickCount - startTime >= holdMs)
break
Sleep 5
}
active := true
Send "{Ctrl down}{Tab}"
KeyWait "RButton"
Send "{Ctrl up}"
active := false
}
#HotIf
#HotIf WinActive("ahk_exe opera.exe") && active
*WheelDown::Send "{Right}"
*WheelUp::Send "{Left}"
#HotIf
ReleaseCtrl(*) {
Send "{Ctrl up}"
}
To use it to switch between tabs, you right-click inside Opera, and after 0.8 seconds, you get the same effect as if you clicked Ctrl+Tab. Then you, while constantly pressing right-click, use the scroll wheel to move between tabs. Once you are on the tab you wanted, you just let go of the right-click.
The 0.8 second delay is so you can still have right-click gestures. You can alter this delay by editing the line
holdMs := 800
inside the script. 1000 is 1 second
This only works on Windows and if Opera is in the foreground. You need to restart the script after reboot...