Move widget keeping pressed a key

Hi everyone, I’m trying to make a UI on my project in which there is a panel (border) when it shows up, and I would be able to move it around the screen by just keeping pressed the key I ordered and ONLY when the user clicks over the panel from this UI.

For now I only have managed to make the panel move by single clicking on it, but I can’t figure out how I have to set this up to make the panel move by keeping pressed a key (left click) and setting it’s position when the user releases the key.

Here’s a screenshot of how I have everything right now.

Do anyone knows how should I do this?

Thank you so much in advance!

Thank you for answering so quick MatzeOGH!
Okay! I’m trying what you say now. But I have a problem, where should I set my event tick?
I’m saying this because I’m trying to set it on my widget event graph, but I cannot call my function OnMouseMove (it’s an overriden function for the panel border from my designer tab).

Here’s a screenshot:

I also considered to implement it on my FPC Blueprint but I don’t know how to make my CastToWidget properly from there (I’m a beginner on Blueprints).

Just with the mouse, when I keep pressed the LMB :slight_smile:

Do you know how to do it MatzeOGH? Please give me a hand, I really need this fixed…

Thank you so much!

Set a boolean to true OnKeyDown and set it to false OnKeyUP. And in the Tick method implement your move logic. That way your widget starts moving whenever you are pressing the key

Do you want to drag the widget around with your mouse or with the keyboard?