UMG: hiden cursor appears after UMG element click

Hi

I’ve got clean project with starter content.

I’ve got simple UMG interface with root, canvas and button on it. On every child cursor parameter was seted to None.

I’ve got player controller just derived from APlayerController and nothing was changed instead checkbox Show mouse cursor, which was switched off.

I’ve got simple HUD:

Now I’ve got a simple cursor. I’m hovering above my button and clicking on it. My cursor appears(UMG in focus ?). After clicking on empty space (not on the button) - cursor is hiding again.
Why does it appears and how to prevent such action?

Hello ,

You said that you have created a new player controller. Did you assign this player controller to the game mode? I was unable to reproduce this issue.

This is what I did:

  1. Created a new blank project
  2. Created a player controller blueprint
  3. Checked show mouse
  4. Created a game mode
  5. Assigned the new player controller to the new game mode
  6. Assigned the new game mode as the one to be used for the level
  7. compiled and save each of the previous

The mouse showed up as expected and was not captured by the screen when clicking somewhere other than the button. Could you tell me what if anything that I did differently? This could help narrow down the issue that you are having.

Hi ,

Checked show mouse

Why have you checked it ? I’m talking about switching it off.

You should set input mode for game & ui.

And the question was: Why when I’m clicking on button, mouse cursor appears?

Hello ,

I misunderstood your question. Could you clear up a few things?

  1. Could you explain what it is exactly that you are trying to do?
  2. Do you want the mouse to show up ever?
  3. If you don’t want the mouse to appear, then why do you have a button?

I’m trying to draw my own cursor (hiding hardware cursor). And with that my cursor I’m trying to work with UMG interface. When I’m clicking on UMG button hardware cursor appears. And I can’t undestand how to avoid that mechanics of drawing hardware cursor when I’m clicking on some UMG element?

Hello ,

Thank you for all of the information and time you have provided. I have submitted a feature request (UE-5367 ) to the development team to all users to set the default cursor. I will provide updates with any pertinent information as it becomes available. I hope this helps.

Make it a great day

Hi , and thank you.

As far as I know, similar request already exists: native software cursor instead of hardware. Can you tell me about progression in this feature?
Or maybe there is some hack around about totaly hiding default hardware cursor?

Hello ,

I may have a workaround for you. It’s a bit ugly but functional. I have attached a couple of files that you will need to make this work. [Btn_Settings][2] This is a notepad file that you will need to copy and paste directly into your event graph for your widget. You will then need to name it Btn_Settings. This is referenced by one of the macros in the following file. [MacroLibrary][1]. You will need to unzip this file and place it’s contents into the content folder of your project.

ButtonSetup and CustomMouse are the macros that that are provided in the zip file.

This is how I set up my character blueprint just in case you need that information as well.

I hope this helps

Make it a great day

Thank you, !
I’ll give it a try

Just ran into this issue myself so if you don’t want to use the built in cursor system: make a widget that has nothing in it, not even canvas. Set it’s visibility to hit test invisible or hidden even.
Go to project settings, add new software cursor, set it to Default / Your new empty widget.

Voila. Even if it “appears”, no problem.
Calling SetFocusToViewport every time after (not ON) you click also sort of works but as ugly as it gets.

On the other hand while hackeries like this work for now but it’s never good if the engine actively fights/disobeys the developer. Not to mention too many things that are covered up by hacks can make for a nice overhead when it comes to resources. So a fix would be neat.

Ran into this problem just now so posting my answer to it.
If you don’t want to use the built in cursor system, you can make a widget that has nothing in it, not even canvas. Set it’s visibility to hit test invisible or hidden even.
Go to project settings, add new software cursor, set it to Default / Your new empty widget.

Voila. A hack basically but works and extremely simple.
Calling SetFocusToViewport every time after (not ON) you click also sort of works but as ugly as it gets.

Unchecking “Is Focusable” on the UMG button fixed this problem for me:

325572-ue4editor-cegpc22yxp.png

1 Like

Just ran into this. Removing focusable fixed it, thank you!

1 Like