I’m trying to make an inventory slot widget that can be clicked to open an item info screen or dragged and dropped to move the item around the inventory. I was able to use the DetectDragIfPressed() in MouseButtonDown to drag, but when I attempt to add the click functionality, it doesn’t seem like there’s a way to do both. I’m not using default buttons and I’ve been trying this in Blueprint (with the widget) and C++ (with a parent of the widget - still a UUserWidget). I’m in Unreal Engine 5.5.4.
My thought process is: OnMouseButtonDown will record the mouse position, OnMouseMove will keep checking if the current position’s distance to the original position is greater than a threshold amount (5-10), if it is - its a drag and to start drag logic (but i can’t call DetectDragIfPressed late, has to be OnMouseButtonDown), and then OnMouseButtonUp if it was not a drag then it was a click and to handle click logic (opening the item info widget).
I’ve been experiencing issues when trying to use DetectDragIfPressed, since the same implies that it will “Detect” the drag, but it simply says its a drag right away anyways if the given key matches.