# Cant hide Mouse Cursor again

**URL:** <https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [November 19, 2017, 7:52am UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006 "2017-11-19T07:52:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_100f129d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_100f129d](https://forums.unrealengine.com/u/anonymous_user_100f129d)\
**Post date:** [November 19, 2017, 7:52am UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/1 "2017-11-19T07:52:06Z")

</div>

i cant hide the mouse cursor again. neither ShowMouseCursor = False, nor SetHardwareCursor = None seems to work. well, sometimes it works, but most of the time it doesnt. i can move the mouse cursor around as much as i want, but nothing happens. the old cursor is still visible. only after clicking, the cursor finally disappears. tested with PIE and standalone window.

 ![220684-bug.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/c/f/bcf2fb7768c9ffc39b85edc3ab0755304fb7a414.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 19, 2017, 11:59am UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/2 "2017-11-19T11:59:20Z")

</div>

When the widget receives focus it starts using its own settings for the cursor, overriding the controller. By default the cursor is visible when interacting with the widget. If you tick the _Cursor_ checkbox and set it to none, your cursor will disappear even if the widget stays in focus:

![220687-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/b/b/cbb9eeb811ef4c9a468c62a531db9fc9a6247cf5.png)

I’m 99% sure that’s how it works.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_100f129d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_100f129d](https://forums.unrealengine.com/u/anonymous_user_100f129d)\
**Post date:** [November 19, 2017, 12:24pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/3 "2017-11-19T12:24:50Z")

</div>

then the cursor would still be visible after clicking, because the widget still has the focus. as soon as you click, the cursor disappears. therefor, this is a bug. edit: actually it doesnt. clicking in the back, makes the widget lose its focus, which explains why the cursor gets updated. i keep forgetting about that, because i worked around that “issue”.

i noticed the overriding thing with my custom/border widget, which i also personally consider a bug. when you not specifically tick the cursor checkbox on, the mouse cursor should not pop up on its own, as long as ShowMouseCursor is set to false. it should always respect that setting.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 19, 2017, 1:38pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/4 "2017-11-19T13:38:51Z")

</div>

> the mouse cursor should not pop up on  
> its own, as long as ShowMouseCursor is  
> set to false. it should always respect  
> that setting.

I agree with that, sure. The current behaviour is counter-intuitive and makes workaround implementation fiddly. Essentially, for as long as the _Cursor_ behaviour tick box is left to its own devices, I’d rather have the controller have full control over the pointer.

Admittedly, I did not test it. Knowing how UMG works, though and how often it takes over the controller (during drag&drop, for example), this is a half-expected, if undesired behaviour.

One of the many quirks of UMG, I guess.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d2b909bf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d2b909bf](https://forums.unrealengine.com/u/anonymous_user_d2b909bf)\
**Post date:** [November 20, 2017, 4:00pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/5 "2017-11-20T16:00:15Z")

</div>

Hello,

Thank you for submitting a bug report. I have reproduced this issue and believe what you are experiencing may be a bug so I logged a report for it here

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-52561)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_368ad427](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_368ad427](https://forums.unrealengine.com/u/anonymous_user_368ad427)\
**Post date:** [February 1, 2018, 1:57am UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/6 "2018-02-01T01:57:42Z")

</div>

Is there a timeline or workaround to this issue? My use case _requires_ that a widget be in focus to allow for controller input to route through it. However because it’s in focus (and this bug) the cursor remains on-screen.

Any suggestions would be appreciated.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1f6d3d501](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1f6d3d501](https://forums.unrealengine.com/u/anonymous_user_1f6d3d501)\
**Post date:** [February 8, 2018, 1:48am UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/7 "2018-02-08T01:48:59Z")

</div>

You should upvote the bug in the tracker so it can get some lovin.

---

<div class="post-metadata">

**Author:** ![TheArchive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheArchive](https://forums.unrealengine.com/u/TheArchive)\
**Post date:** [March 26, 2018, 10:44pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/8 "2018-03-26T22:44:21Z")

</div>

I’m not sure if you’re still looking for a good workaround for this bug but I may have one for you. I was having the same issue but for me it was because I was trying to hide the cursor when a Gamepad is being used and show it when the mouse is moved.

I created two copies of my cursor widget, named one hidden and the other shown, then created two events to set them after setting showmousecursor true or false. I don’t know if it will work for you but I figured I’d mention it in case it does.

 ![235166-hidemouseworkaround.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/6/e/a6e0aa7b1a07339e3c4c3790abadf5b1c3449bae.png)

---

<div class="post-metadata">

**Author:** ![Shmoopy1701](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shmoopy1701/32/1194536_2.png) [@Shmoopy1701](https://forums.unrealengine.com/u/Shmoopy1701)\
**Post date:** [May 22, 2018, 5:07pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/9 "2018-05-22T17:07:46Z")

</div>

Tried this workaround. In one app it works, in another one it doesn’t. ;(

---

<div class="post-metadata">

**Author:** ![Shmoopy1701](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shmoopy1701/32/1194536_2.png) [@Shmoopy1701](https://forums.unrealengine.com/u/Shmoopy1701)\
**Post date:** [May 22, 2018, 5:11pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/10 "2018-05-22T17:11:46Z")

</div>

Dealing with this again as well. In last app we ended up doing the UI button code from scratch due to UMG problems with focus getting stuck and randomly showing the hardware cursor.

Not an option this time. Would be nice if this stuff worked. ;(

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_368ad427](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_368ad427](https://forums.unrealengine.com/u/anonymous_user_368ad427)\
**Post date:** [July 25, 2018, 6:52pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/11 "2018-07-25T18:52:14Z")

</div>

I got tired of waiting on this (don’t think we’re ever going to get a fix from Epic), so I’ve made a couple of engine changes. This worked for us but your mileage may vary. Obviously these are CODE changes, I don’t have anything useful to fix this from blueprints.

The first issue is that bShowMouseCursor on APlayerController doesn’t work. It looks like the cause of this lives in UGameViewportClient::GetCursor. What you need to do is disable/remove the first IF block in this method. This is what you should be left with:

```
EMouseCursor::Type UGameViewportClient::GetCursor(FViewport* InViewport, int32 X, int32 Y)
{
	if (GameInstance && GameInstance->GetFirstLocalPlayerController())
	{
		return GameInstance->GetFirstLocalPlayerController()->GetMouseCursor();
	}

	return FViewportClient::GetCursor(InViewport, X, Y);
}

```

Unfortunately, this by itself doesn’t do anything, because this code only runs when you move the mouse. If you’re like me and are trying to disable the mouse while a gamepad is active, you want this to reevaluate immediately. Fortunately, you can do that with a single call. I would do this whenever you modify bShowMouseCursor.

```
PlayerController->bShowMouseCursor = false;
FSlateApplication::Get().OnCursorSet();

```

The mouse should now respect the bShowMouseCursor flag and hide appropriately. However, we’re still not done, because if the cursor is above the window, it can still trigger mouse events despite being hidden. (Gamepad input changing menus would be a good cause of this.)

To fix this, you’ll want to find the method FSlateApplication::SynthesizeMouseMove. At the top of this method, add this block of code.

```
if (GetSoftwareCursorVis() == EVisibility::Hidden)
{
	return;
}

```

That should be it! The mouse should now hide and no longer trigger any events while the bShowMouseCursor is false. Hopefully this helps someone.

---

<div class="post-metadata">

**Author:** ![Salty\_Panda\_St](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/salty_panda_st/32/604125_2.png) [@Salty\_Panda\_St](https://forums.unrealengine.com/u/Salty_Panda_St)\
**Post date:** [January 7, 2019, 2:21pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/12 "2019-01-07T14:21:38Z")

</div>

Thanks a lot for this!

You can actually override `EMouseCursor::Type UGameViewportClient::GetCursor` in your own ViewportClient class.  
We had one already cause of some Splitscreen stuff.  
Not sure about the `FSlateApplication::SynthesizeMouseMove` stuff yet, but I doubt it will be a problem for us. Generally just want to hide the ■■■■ cursor when navigating UI with a Gamepad.

---

<div class="post-metadata">

**Author:** ![VIVANR3D](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VIVANR3D](https://forums.unrealengine.com/u/VIVANR3D)\
**Post date:** [January 8, 2019, 5:41pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/13 "2019-01-08T17:41:09Z")

</div>

Is this problem solved or not I have the same problem . I did the logic to Hide Cursor when user try using the game pad and when user try using mouse it shows Cursor but when I use the blueprint it doesn’t hid Cursor again at first its OK but when I try for second time its not hide the Cursor what should I do ? write the code in c++ as blueprint or I’m doing something wrong ? 4.21

 ![264627-ss.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/4/a/04a06ec5c22fc0186dcea2f69659bcf91053736f.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_368ad427](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_368ad427](https://forums.unrealengine.com/u/anonymous_user_368ad427)\
**Post date:** [January 8, 2019, 6:38pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/14 "2019-01-08T18:38:02Z")

</div>

I posted a fix below but it involves changing engine code. There’s no fix from Epic as far as I’m aware.

---

<div class="post-metadata">

**Author:** ![laggyluk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@laggyluk](https://forums.unrealengine.com/u/laggyluk)\
**Post date:** [January 23, 2019, 9:07am UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/15 "2019-01-23T09:07:26Z")

</div>

In my case cursor was staying visible after clicking a button and leaving the UI area where it should disappear, fixed with SetFocusTogameViewport node

 ![266227-nocursor.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/3/1/b3132bf1ec32dfcd9aef9e1f186a6e32d2647ab0.png)

---

<div class="post-metadata">

**Author:** ![eobet](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eobet/32/465239_2.png) [@eobet](https://forums.unrealengine.com/u/eobet)\
**Post date:** [March 14, 2020, 3:58pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/16 "2020-03-14T15:58:12Z")

</div>

I cannot get this to work in 4.24 ☹

---

<div class="post-metadata">

**Author:** ![Berkay\_Tuna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Berkay\_Tuna](https://forums.unrealengine.com/u/Berkay_Tuna)\
**Post date:** [April 2, 2020, 5:14am UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/17 "2020-04-02T05:14:57Z")

</div>

if you check the cursor box and then set it to none, mouse cursor wont show up when on that element. So, i just put an image to cover my whole screen within the mainHUD and then set the opacity to 0, so that the image does not show up during the play. I no longer see the cursor.

---

<div class="post-metadata">

**Author:** ![zgzg2020](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zgzg2020](https://forums.unrealengine.com/u/zgzg2020)\
**Post date:** [November 23, 2020, 6:23pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/18 "2020-11-23T18:23:38Z")

</div>

This bug still exists in 4.25.4… :’(

---

<div class="post-metadata">

**Author:** ![zgzg2020](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zgzg2020](https://forums.unrealengine.com/u/zgzg2020)\
**Post date:** [November 23, 2020, 6:24pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/19 "2020-11-23T18:24:48Z")

</div>

How did you work around this bug?

---

<div class="post-metadata">

**Author:** ![zgzg2020](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zgzg2020](https://forums.unrealengine.com/u/zgzg2020)\
**Post date:** [November 23, 2020, 6:28pm UTC](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006/20 "2020-11-23T18:28:50Z")

</div>

Could you kindly show a Blueprint script of this?

[Next page](https://forums.unrealengine.com/t/cant-hide-mouse-cursor-again/410006.md?page=2)
