Does anyone know how to make a drag&drop Operation using keyboard keys or gamepad keys? Without using any mouse click events?
I know how to do a Drag&Drop operation with mouse (The Classic One). Any info about it the gamepad version would be appreciated. I am trying this the last 4 days… Thanks!
That s a bad design to make drag and drop with controller.
Hi! A bit late answer after some months…
You can create mouse events with other buttons than the left click mouse button, by adding the buttons you would like to create the events in your PlayerController > MouseInterface.
EnableClickEvents > True
ClickEventsKeys > Add to the array any button you like (My example is with Gamepad Face Button Bottom)
This will create the event you are searching. Hope that helps!
Thank you Sielo_86!
what it that a post to do?
it did not work when i use a gamepad is copy the input as a ClickEvents on a ui?
podria explicar como implementar el resto?
Can someone test this out in UE 5.1? Because I have been trying for the past few hours and nothing is happening on my end. Would appreciate some feedback on this since theres barely any related to drag and drop on gamepads.
I’m struggling with this too
Could you explain how to implemen
I advise you guys to simulate a drag on gamepad without using the DETECT DRAG node because that node only listens to mouse inputs which is mind boggling to know that UE5 doesnt have basic features like that.
Either way, I advise using UI navigation free plugin on the marketplace, with it comes a node called “Simulate left click press” so whenever you want to drag something with (lets say the button X of your ps4 gamepad" you can just call the Simulate left click press and it will try to interact with the node but the detect drag will still not work (at least it didnt work for me).Make sure to switch your controller to a child of UINAV PC or else it wont accept controler inputs I think.
So now that your ui accepts your ps4 gamepad inputs properly you can override your slot’s ONPREVIEWKEYDOWN function and create a widget made by you (a simple image works, lets call it Fake Drag) so create the widget, now set the fake drag image to be the same exact image that matches the one from the slot you are trying to drag from.
Now you just need a way to attach the Fake drag widget to your cursor, this can be done in multiple ways, you can try setting the Fake Drag widget position to the cursor position on tick or if you are like me, my in game cursor is a cursor that I made in an actual widget so if I go to my cursor widget I can simply add a box next to my cursor and now I can simply simply spawn the Fake Drag inside that box instead of changing its position on tick.
Also make sure that when you are starting a drag you store a reference to the slot you started dragging from somewhere in your inventory or character blueprint so then you can pick up all the necessary info you may need.
All thats left is to override the ONMOUSEBUTTONUP function in your slot, because when you stop dragging you also are triggering the ONMOUSE BUTTONUP function.
So ONMOUSEBUTTONUP you are gonna destroy the FAKE DRAG Widget and send a reference of this slot which you stopped dragging in to wherever you stored the reference of the slot you started dragging from so now you can do all calculations you need with the 2 references.
I hate having to explain this because the proccess always seems extra complex and tedious but its usually just 5min of work.
If any problem arrives while following this tutorial, please ask. God I will probably need to do a tutorial vid on this.
tutorial vid noob here it when over my head please and thanks u
Made a tutorial for ya,its not the best, but it is what it is
I made a quick update note on my comment section of that video I published, which fixes the mouse flickering when you start and stop dragging. Now its much smoother and doesnt disappear when you start/stop dragging!
Perhaps check it out if it annoys you or if you want the extra polish!
can i get the download for your project plz and thanks you thanks you going to try to turn it to a plugin
Hi, I dont think I have the project anymore, I did the video and deleted the project since I was not gonna use it anymore.
The tutorial is very beginner friendly, and as soon as you understand the logic of it, you will understand everything. Try to follow the tutorial, plz.
This will not be a plugin.
I have been using this technique on my personal project and has been working most fine for me, if you have any problems you can always ask me on the description of the video.
opps im try to make it into a plugin not u lol my bad eng hard when u sleeping lol