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"

How to get which key was pressed in blueprint

Hi all, how I can get which key was pressed using blueprint?

I known that you can use override function in widgets OnKeyDown and compare if it equal to specific key, but how I can get exactly which input key was pressed and displayed in Print string ?

Thank you guys!

Product Version: UE 4.10
more ▼

asked Dec 25 '15 at 03:22 AM in Blueprint Scripting

avatar image

21 5 7 11

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

2 answers: sort voted first


I found the solution, I just missed one node, may be was just tiered :)

Thank you for you help!

alt text

untitled-1.jpg (115.5 kB)
more ▼

answered Dec 25 '15 at 09:21 AM

avatar image

21 5 7 11

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

I am not sure what you are asking but here is an answer hope it helps: Inside of the player blueprint, and make a new blueprint (An input key), make it the key you want to be the key that the string notices. And attach the input blueprint to a print string and type in a message with whatever you want in it.

Hope this helps! Happy game development!

more ▼

answered Dec 25 '15 at 04:14 AM

avatar image

86 18 19 25

avatar image Vector Dec 25 '15 at 05:23 AM

Thanks for answer and merry Christmas!

I was asking to get key i pressed to text. If i pressed space bar i need to get it in text (key name), i need know which key has been pressed by player.

Thank you

avatar image Designer102 Dec 26 '15 at 04:57 PM

Well, if that's the case than I think you can still set up inputs for every key and then have them have different text strings for example: You could set up the inputs for all your keys, and then set up print lines or print text to the input and make the text say something like (Key name) was pressed. It would take a while but it is the way that is the simplest. You could always attach an event or cast to a widget but that is a lot more time consuming and harder. Hope that helps.

(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