UI widget is not working properly

Hello everyone

I want to create a simple menu with a few buttons. I want it to appear by pressing the ‘M’ key and also to make it disappear by pressing the same key. I made a similar project in unreal 4.10 (working just fine) and copy pasted the blueprint in unreal 4.11.

In this project for some strange reason when I press the ‘M’ key the menu doesn’t go away. I need first to press one of my menu buttons and then by pressing the ‘M’ key the menu disappears. I have enabled ‘is Focusable’ in my buttons I have called the SetInputModeUIOnly and I am using the OnKeyDown function.

Any help would be much appreciated thank you.

Try also setting the keyboard focus to the widget you are clicking, after setting the input to UI.

In 4.11 there are several focus bugs with UMG and they do not have them all sorted out yet. One workaround has been to only call the SetInput nodes from the PlayerController, and be sure to get a reference to self and pass that in. It no longer works to just leave the default “self” in the node.

Thank you so much for your answer

I have used the keyboard focus, regarding to the SetInputModeUIOnly I am not quite sure what to do. Below is my Level blueprint setup