Skip to content

Differentiate getDistanceFromDragStartX left/ right mouse button. #192

Answered by dnaldoog
Ted-juh asked this question in Q&A
Discussion options

You must be logged in to vote

This is how I did it. I use lua to detect whether right or left button clicked and then plot the x,y separately. Maybe there's a better way?

In this panel x,y coordinates are limited to the comp:getHeight() and comp:getWidth() with my new friend jlimit()!

Tedjuh distance travelled_1_1_1_2021-02-28_21-38.zip

constructor = function()
    myMeta={
        leftDragDistance = 0,
        rightDragDistance = 0,
        leftDragDistance = 0,
        rightDragDistance = 0,
        left={enterX = 0,enterY = 0,leaveX = 0,leaveY = 0},
        right={enterX = 0,enterY = 0,leaveX = 0,leaveY = 0},
		--engagedButton="left"
    }
    coords = setmetatable({},{__index=myMeta})
end
mouseDown = function(--…

Replies: 8 comments 22 replies

Comment options

You must be logged in to vote
7 replies
@dnaldoog
Comment options

@dobo365
Comment options

@dobo365
Comment options

@dnaldoog
Comment options

@Ted-juh
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Ted-juh
Comment options

You must be logged in to vote
1 reply
@dnaldoog
Comment options

Comment options

You must be logged in to vote
2 replies
@dobo365
Comment options

@Ted-juh
Comment options

Comment options

You must be logged in to vote
6 replies
@Ted-juh
Comment options

@Godlike-Productions
Comment options

@Ted-juh
Comment options

@Godlike-Productions
Comment options

@Ted-juh
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@dobo365
Comment options

@Ted-juh
Comment options

Comment options

You must be logged in to vote
4 replies
@dnaldoog
Comment options

@Ted-juh
Comment options

@dobo365
Comment options

@Ted-juh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants