x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to lock the mouse in a widget?

Hi,

Is anyone know how to lock the mouse cursor inside a specific widget through blueprint? The only node that seam to be made for that is Lock Mouse but I can't understand how to use it.

Thanks,

Product Version: UE 4.17
Tags:
more ▼

asked Nov 06 '17 at 07:39 AM in Blueprint Scripting

avatar image

Shonan80
6 3 4 7

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

By lock mouse you mean to restrict mouse movement within a specific widget? Something like this:

https://gyazo.com/f7ab68ee3d52486e4e721216111961db

The button flips a boolean value:

alt text

The overriden MouseMove keeps the cursor locked within the widget bounds based on the state of the bool set by the button above:

alt text

lockbutton.png (45.5 kB)
mousemove.png (85.0 kB)
more ▼

answered Nov 06 '17 at 08:03 AM

avatar image

Everynone
12.6k 72 24 52

(comments are locked)
10|2000 characters needed characters left

This is exactly what I wanted to do, thank you very much!

more ▼

answered Nov 07 '17 at 01:36 AM

avatar image

Shonan80
6 3 4 7

avatar image Everynone Nov 07 '17 at 09:59 AM

Consider flagging it as answered. Helps others find the answer quicker! And good luck.

avatar image antonis74 Jan 27 '19 at 08:22 AM

I have a situation where my widget is fullscreen (using a background blur) and there is another border component inside it with smaller dimensions. I tried to use the lock mouse example above in the overriden MouseMove event bound to the border but the mouse does not stay in bounds. I am using ue 4.21. Is there something wrong?

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question