It depends on your other configuration somewhat. If you are not using strokes via StrokeFunc, and have stroke support compiled in it can be done. Also if you are using strokes, and have no very simple strokes (i.e straight lines) it can also be done easy.
DestroyFunc DragViewPort
AddToFunc DragViewPort
+ I StrokeFunc
+ I PipeRead "echo Scroll $(($[pointer.x]-$0))p $(($[pointer.y]-$1))p"
Mouse 1 R M DragViewPort $$[pointer.x] $$[pointer.y]
If you are using simple strokes (taht can be matched by any viewport motion you might want to do) you will have to make additional modifications of the stroke bindings to disable them.
DestroyFunc StartDragViewPort
AddToFunc StartDragViewPort
+ I UnsetStrokeBindings
+ I DragViewPort $[pointer.x] $[pointer.y]
+ I SetStrokeBindings
Where you have to move all your ‘Stroke sequence 0 … commands’ to a function SetStrokeBindings and also create a corresponding UnsetStrokeBindings function that disables the strokes.
The use of the StrokeFunc command is required since there is no other way to wait for a key release in function execution.