# Hide the mouse cursor in a UMG menu when a gamepad is used

**URL:** <https://forums.unrealengine.com/t/hide-the-mouse-cursor-in-a-umg-menu-when-a-gamepad-is-used/384029>\
**Category:** UI\
**Tags:** ai-navigation, Input, unreal-engine, Widget, Blueprint, question, UMG\
**Created:** [February 5, 2017, 10:05pm UTC](https://forums.unrealengine.com/t/hide-the-mouse-cursor-in-a-umg-menu-when-a-gamepad-is-used/384029 "2017-02-05T22:05:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fjellgnu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fjellgnu](https://forums.unrealengine.com/u/Fjellgnu)\
**Post date:** [February 5, 2017, 10:05pm UTC](https://forums.unrealengine.com/t/hide-the-mouse-cursor-in-a-umg-menu-when-a-gamepad-is-used/384029/1 "2017-02-05T22:05:13Z")

</div>

I have menu system created in UMG. It allows mouse, keyboard and gamepad inputs. The thing is, I would like the mouse cursor to disappear when a gamepad is in use. To me it seems logical to test a keypress and check if that came from a gamepad or not. If it does, hide the mouse cursor!

I am using a function override called OnKeyDown:

 ![125077-onkeydown.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/a/dca717c01bf50dad78d5aea143e8b77f20d47e68.png)

Now I am probably missing something or there is something I don’t understand! When navigating the menu with a gamepad the left stick and d-pad moves the focus field around to the individual buttons and the ‘face button down’ is used to “click” on a button. This override function works with all the other keys, but not the ones used to control the menu.

Is there a way to do a similar check on the left stick, d-pad and ‘face button down’ in a widget blueprint (or include them in this function)? Or is there another way to do this?

---

<div class="post-metadata">

**Author:** ![Goanna7007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Goanna7007](https://forums.unrealengine.com/u/Goanna7007)\
**Post date:** [February 5, 2017, 10:49pm UTC](https://forums.unrealengine.com/t/hide-the-mouse-cursor-in-a-umg-menu-when-a-gamepad-is-used/384029/2 "2017-02-05T22:49:58Z")

</div>

To Hide the mouse cursor you can use “Set Show Mouse Cursor”

---

<div class="post-metadata">

**Author:** ![Fjellgnu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fjellgnu](https://forums.unrealengine.com/u/Fjellgnu)\
**Post date:** [February 5, 2017, 11:02pm UTC](https://forums.unrealengine.com/t/hide-the-mouse-cursor-in-a-umg-menu-when-a-gamepad-is-used/384029/3 "2017-02-05T23:02:05Z")

</div>

Yes, I know. My problem is how to include ALL the keys on the gamepad when I check which buttons are pressed!

The function in my screenshot is just checking unused buttons, unfortunately. ☹

Thanks for answering!

---

<div class="post-metadata">

**Author:** ![Fjellgnu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fjellgnu](https://forums.unrealengine.com/u/Fjellgnu)\
**Post date:** [February 6, 2017, 12:29am UTC](https://forums.unrealengine.com/t/hide-the-mouse-cursor-in-a-umg-menu-when-a-gamepad-is-used/384029/4 "2017-02-06T00:29:36Z")

</div>

Okay, so now I feel really stupid!

OnPreviewKeyDown and Unhandled did the trick:

 ![125103-onpreviewkeydown.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/1/cc1b43531c81e21394913bcc0e7d9bbba03ac475.png)

I find the answer to something shortly after posting a question about it. I really should ask a LOT more questions!!! 🙂

---

<div class="post-metadata">

**Author:** ![v\_i\_m](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@v\_i\_m](https://forums.unrealengine.com/u/v_i_m)\
**Post date:** [September 18, 2019, 3:35pm UTC](https://forums.unrealengine.com/t/hide-the-mouse-cursor-in-a-umg-menu-when-a-gamepad-is-used/384029/5 "2019-09-18T15:35:04Z")

</div>

With Input Mode: Game and UI you can’t hide the mouse cursor by setting Show Mouse Cursor tho. I’m trying to figure out how that would work… I can’t hide the cursor when the gamepad is used.

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [March 18, 2021, 4:46pm UTC](https://forums.unrealengine.com/t/hide-the-mouse-cursor-in-a-umg-menu-when-a-gamepad-is-used/384029/6 "2021-03-18T16:46:29Z")

</div>

You might want to turn game-only input back on when you detect gamepad input since you won’t be using the cursor that handles ui input anyway (I presume) I toggle to game-only input and then hide cursor when any gamepad input is detected, and toggle back to game&ui mode as soon as any non gamepad input is detected.

---

<div class="post-metadata">

**Author:** ![Helltaker](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/helltaker/32/1159353_2.png) [@Helltaker](https://forums.unrealengine.com/u/Helltaker)\
**Post date:** [April 8, 2026, 9:10am UTC](https://forums.unrealengine.com/t/hide-the-mouse-cursor-in-a-umg-menu-when-a-gamepad-is-used/384029/7 "2026-04-08T09:10:13Z")

</div>

Figured it might be helpful for others to find this here some-when in the future.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/4/e2466528a42e495a455ed0ccd8af9642434fb201.jpeg)
