Hold my side button and swipe to switch desktops
Assuming you want to hold Mouse4 (the back side button) and flick left or right to switch virtual desktops, here is a complete script.
Because modifying or swallowing mouse movement with OnMove requires intercepting physical motion, this script requires a Rebind Link.
Mouse4, OnDown swallows the initial click. If you release the button without moving past the threshold, OnUp sends the original Mouse4 press so you can still use it as a normal back button.Mouse4, OnMove accumulates horizontal mouse delta (accum_x) and swallows cursor movement so the pointer doesn't slide across your screen.switch_desktop() triggers the OS shortcut (Ctrl + Win + Left/Right on Windows; Ctrl + Left/Right on macOS) via HID.Combo and resets the accumulator, allowing multiple swipes in a row if desired.