# Open and close a widget with one key?

**URL:** <https://forums.unrealengine.com/t/open-and-close-a-widget-with-one-key/451090>\
**Category:** UI\
**Tags:** unreal-engine, Widget, question\
**Created:** [June 21, 2019, 9:50pm UTC](https://forums.unrealengine.com/t/open-and-close-a-widget-with-one-key/451090 "2019-06-21T21:50:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JWALKAZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JWALKAZ](https://forums.unrealengine.com/u/JWALKAZ)\
**Post date:** [June 21, 2019, 9:50pm UTC](https://forums.unrealengine.com/t/open-and-close-a-widget-with-one-key/451090/1 "2019-06-21T21:50:22Z")

</div>

Ive been trying to make an inventory open with “I” and then once in the inventory close it with “I”.

The problem from what I understand is that when I’m opening the inventory I have the game pause and setting to ui mode only so it wont register the player hitting “I”.

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [June 21, 2019, 9:56pm UTC](https://forums.unrealengine.com/t/open-and-close-a-widget-with-one-key/451090/2 "2019-06-21T21:56:34Z")

</div>

This should help put this inside your Player Controller

> **[Gyazo](https://gyazo.com/94abd4dee51524e1e01a01940b3d351c)**
>
> Easily capture screenshots, GIFs, and replays that are ready to share. Download the free app for windows and mac.

---

<div class="post-metadata">

**Author:** ![JWALKAZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JWALKAZ](https://forums.unrealengine.com/u/JWALKAZ)\
**Post date:** [June 21, 2019, 10:04pm UTC](https://forums.unrealengine.com/t/open-and-close-a-widget-with-one-key/451090/3 "2019-06-21T22:04:25Z")

</div>

What is your game options WB?

---

<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:** [June 22, 2019, 8:09am UTC](https://forums.unrealengine.com/t/open-and-close-a-widget-with-one-key/451090/4 "2019-06-22T08:09:51Z")

</div>

It’s a reference to the widget, you can see it being Set after the widget is created. Right clicking the _Return Value_ pin and _Promoting_ does the job here.

Also this method is not applicable if you want to open the widget and give it input exclusivity via `UI only Mode`.

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [June 23, 2019, 3:19am UTC](https://forums.unrealengine.com/t/open-and-close-a-widget-with-one-key/451090/5 "2019-06-23T03:19:06Z")

</div>

Thats a Promoted Variable of the Widget so i can reference to remove from parent when i press Esc again after i opened it, this works i have it in my project and have no problems

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [June 23, 2019, 3:21am UTC](https://forums.unrealengine.com/t/open-and-close-a-widget-with-one-key/451090/6 "2019-06-23T03:21:47Z")

</div>

Also i have a Options Menu for my Main Menu then a Game Options for when im in game they look the same just different buttons are added for In Game
