I made a simple inventory UI using UMG scroll-box.
I can scroll and click items on the scroll-box without any problem.
However, I would like to disable the right mouse click and drag function on the scroll-box.
I’ve tried to override EventOnDragEnter / OnDragOver / OnDragDetected but there is no use, the right mouse click/drag function keeps interacting with my scroll-box.
Is there any way to disable the right mouse click/drag function for scroll-box?
I believe there is no way to do it without digging into Slate. Scrollbox is not as flexible as it should be.
If it’s a gamebreaker, you could create your own custom scrollbox.
Depending on what you have in your scroll box (if it’s another Widget item that you’ve created) I believe you can try detecting drag in that class, (using rmb instead of lmb) but just have it not do anything, that way drag input is focused on the object in the scrollbox, rather than the scrollbox itself.
I dug into the SScrollbox.cpp in source code, found out the right mouse drag and click function and changed it accordingly.
And it worked!
(In PIE and packaged game, right mouse click and drag no longer interfering with my scroll-box, cursor, and I don’t have to tolerate that stupid grabbing icon any more!)
Simply return the function with Unhandled() works for me!