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"

Widget key press

How can I make a key press in a widget? So if I press Q when the widget is open, it will print hello

Product Version: UE 4.18
Tags:
more ▼

asked Dec 31 '17 at 06:22 PM in Blueprint Scripting

avatar image

Blackforcedragon
0 2 7 9

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

I did find a answerto my question. alt text

key-press.png (106.4 kB)
key-press-2.png (104.6 kB)
more ▼

answered Dec 31 '17 at 07:01 PM

avatar image

Blackforcedragon
0 2 7 9

(comments are locked)
10|2000 characters needed characters left

You can use an event dispatcher in your controller blueprint.

I've added an action mapping in the project settings. I've called this one "test" and have assigned the key "Q".

Upload images

Then in the controller blueprint I just create an event dispatcher called "want to print hello"

Upload images

And this event is binded inside the widget blueprint, on construct:

Upload images

The input mode must be set to game and UI, so it can be good to set the game paused when you open your widget ( but it depends on the context ). In this case you must check " execute when paused" on the input in the controller:

Upload images

Hope it can help you

more ▼

answered Dec 31 '17 at 07:15 PM

avatar image

Grot13
36 1 3

avatar image Blackforcedragon Dec 31 '17 at 07:16 PM

I did that, and it worked

(comments are locked)
10|2000 characters needed characters left

Yep you found the solution while I was making my message..

more ▼

answered Jan 01 '18 at 12:02 PM

avatar image

Grot13
36 1 3

(comments are locked)
10|2000 characters needed characters left
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