Customizable mouse gestures
-
abb-droidev last edited by
"Mouse Right Click(Hold) + Move Left/Right" actions should be replaceable with "Cycle tabs" action like Vivaldi. This is very important feature. Making tab changing and exploring very fast.
-
denistablica last edited by
@Krusdy
Hello
I made a small script that lets you use sustained right-click + wheel scroll to switch between tabs.- You need to download an AutoHotkey app from autohotkey.com Download and install v2.
- Create scroll.txt file and paste this inside the file
#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}"
#HotIfReleaseCtrl(*) {
Send "{Ctrl up}"
}- Close the file and save, then rename the saved file ending from scroll.txt to scroll.ahk
- Double-click on scroll.ahk to start it.
- If you get an antivirus notification about this file, you should make an exception for it. It's a false positive because AutoHotkey app is intercepting clicks and sending modified inputs to Opera.
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...