# How to use the same key for toggling widget visibility?

**URL:** <https://forums.unrealengine.com/t/how-to-use-the-same-key-for-toggling-widget-visibility/362187>\
**Category:** UI\
**Tags:** viewport, unreal-engine, Widget, UE4, Blueprint, question\
**Created:** [June 27, 2016, 6:03pm UTC](https://forums.unrealengine.com/t/how-to-use-the-same-key-for-toggling-widget-visibility/362187 "2016-06-27T18:03:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klookster](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Klookster](https://forums.unrealengine.com/u/Klookster)\
**Post date:** [June 27, 2016, 6:03pm UTC](https://forums.unrealengine.com/t/how-to-use-the-same-key-for-toggling-widget-visibility/362187/1 "2016-06-27T18:03:04Z")

</div>

This issue seems to be easy but it really drives me nuts. The thing is, that it has to be able to be interrupted by a mouse click. The mouse click works. So this is what I’m trying to achieve:

- **press space** to show the menu widget (works)
- **click** on menu point to call an in-game action and then get back to viewport (works)

OR

- get back to viewport by **pressing space again** _without_ clicking a menu point (doesn’t work in combination)

I tried several ways, chiefly flow controls, but the second input from the space bar seems to be a real issue in the blueprint. It can’t just flipflop every time from status a) to status b) because there’s no way to predict the user’s interaction.

Is there somebody who knows ho to fix that? Thanks in advance!
