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 ?
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.
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.
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.
I was in the process of doing an input buffer system in BP since I didn’t really see too much on it and ran across this post and used THIS post for a starting point actually.
In the future, please only use code that is relevant to the question. It can really confuse beginners who think they might need all of this to preform the very simple task.