On Click Mouse Override with Left Click, Right Click and Drag abilities.

Hi all,

So i’m currently in the process of setting up my own little inventory system. Like any inventory the slots are made up of buttons that do different things when clicked on. What I want is to be able to right click, left click and drag the items around. Left Click/Right click was a simple override of the Mouse Down function that splits on “get effecting button” and runs what i need it to do. My problem comes with trying to tell the difference between a drag and a normal left click.

I know the code i’m uploading is wrong as it will always run detect drag, i’m just wondering if their is a node i am missing that will run a branch and see if it is a click or a drag on the left mouse button

Found a solution over on reddit.

“I don’t know about the mouse event detect drag, but what i have done in the past is also listen for a “left click release” and use the release and press to make a timer of how long the button is held. By default assume drag, and if button is released after 0.2 seconds, assume click. You would think this feels bad, but lots of interfaces actually use on left click release as the trigger for left click. This means if you miss click say on a button you can drag off of it and release it and nothing happens. This is all over windows.”