How to get which key was pressed in blueprint

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!