Created
October 1, 2021 14:31
-
-
Save cptSwing/3947adef7431322d85638a31192a88d9 to your computer and use it in GitHub Desktop.
I added this in StrokesPlus as an application only script, and set the gestures to react to middle mouse button, left and right 'swipe'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// last element in array | |
var lastGesturePointInArray = action.GesturePoints.Length - 1; | |
// pixels travelled | |
var distanceTravelled = action.GesturePoints[lastGesturePointInArray].X - action.GesturePoints[0].X; | |
// Edit if need be: | |
var horizScrollDist = 1.5; | |
// turn to absolute num | |
if (distanceTravelled < 0) { | |
distanceTravelled *= -1; | |
horizScrollDist *= -1; | |
}; | |
horizScrollDist *= distanceTravelled; | |
//sp.ConsoleLog('\n'); | |
//sp.ConsoleLog(action.GesturePoints[0]); | |
//sp.ConsoleLog('traveling left: ' + distanceTravelled); | |
// X axis value started out at | |
var startX = action.GesturePoints[0].X; | |
// M.Wheel-scroll-to, horizontally, by n pixels | |
sp.MouseWheel(new Point(parseInt(startX + distanceTravelled), action.GesturePoints[0].Y), true, parseInt(horizScrollDist)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment