How do I set mouse boundaries?

I am doing a top down game and the character is following the cursor around the screen. The control handling isn’t perfect, if the cursor touches one of the 4 walls (in the box room) the character will stop moving completely until the cursor is moved back to the floor…

What would be the easiest solution to this problem? I am fairly new with UE4 but I have tried adding a trigger box but I can not think of any nodes which can basically tell the cursor to stay within the box at all times.

I will leave a screenshot of the defualt cursor blueprints that come with the top down game template, I have only one gate as I did not require it for what I am doing but the rest of the nodes are all from the template.

Any advice is greatly appreciated.

Many thanks.