x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

4.7.3 Disable input while menu is open except one key

Hey everyone,

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.

Product Version: Not Selected
Tags:
more ▼

asked Apr 01 '15 at 04:07 AM in Blueprint Scripting

avatar image

5Kwatts
117 12 9 16

avatar image 5Kwatts Apr 03 '15 at 03:51 PM

Bump. I'm still having some issues with this. The only thing I can think of that might allow this behavior, to my knowledge unless someone can inform me, is to make a specific menu player controller, posses my pawn with it on menu open, and re-posses with character player controller on exit. But I feel like there should be an easier way than this design.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

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.

https://forums.unrealengine.com/showthread.php?54237-binding-umg-buttons-to-input-keys

more ▼

answered Apr 19 '15 at 10:17 PM

avatar image

5Kwatts
117 12 9 16

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Apr 03 '15 at 04:37 PM

avatar image

Imonin
16 1 4 8

avatar image 5Kwatts Apr 04 '15 at 03:17 PM

I thought of that as well but I wanted to avoid doing that as I have several key inputs and don't want to put a conditional on them all.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I find excellent soluiton.Thanks to Mathew Wadstein! https://www.youtube.com/watch?v=HguI4RPURYc

more ▼

answered Oct 30 '17 at 01:02 PM

avatar image

organicFoil
6 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question