4.7.3 Disable input while menu is open except one key
I was looking to see while my UMG character menu is open, disable player controller until the player closes the menu with the same key. So if I press "C" to open the menu, I want to only be able to close the menu with "C" while disabling all other controls. I do not want to resume input from a widget in the menu.
I looked into Disable Input/ Enable Input and also Set Input Mode UIOnly and Set Input Mode Game Only, but these will not give me the "C" key to fire. Is there an exception to still look for "C" that I can add to these existing functions? I have multiple key inputs and do not want to check if menu is open on all of them.
Thanks for you're input.
asked Apr 01 '15 at 04:07 AM in Blueprint Scripting
This is the link that I followed to complete this for anyone else. In the widget class, Override the OnKeyDown/Up events. and on those events check which key is pressed with "GetKey" and do your logic from there. To set widget to have keyboard input, where ever you are creating the widget, with Add to Viewport, add another function for "Set Keyboard Focus" and pass the widget to it. Screenshots are in the link.
answered Apr 19 '15 at 10:17 PM
There is another way. However its not very elegant. You could add a branch after every input with the bool of ?input allowed. This would allow you to change the bool value and block input or change the input to the menu only for that one button if the value is false. I hope that helps.
answered Apr 03 '15 at 04:37 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here