Get letter value of pressed key in blueprints

I would like to be able to call a function when any letter key is pressed on the keyboard. Is there a way to make it so that any keyboard press triggers the same function which then retrieves the value of the pressed key as a string and uses it in said function?

Hey Death_With_An_H,

I have looked over the different nodes provided for keyboard commands in the blueprint editor. I do not see one that’s dedicated for the whole keyboard. So if you want the whole keyboard to be unusable except for one command, you’d need to set it up that way for each key. There may be a way in C++ to do this however, I unfortunately do not know that much in-depth information regarding C++.

Here are a few links to some documentation regarding input:

  • [Input Documentation
  • [How to Set Up Input on an Actor][2]
  • [How to Set Up Input on an Actor in Blueprints][3]

Let us know if there are any other questions that you may have, thanks! :slight_smile:

Input in Unreal Engine | Unreal Engine 5.1 Documentation
[2]: Setting Up User Inputs in Unreal Engine | Unreal Engine 5.1 Documentation
[3]: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/ActorInput/Blueprints/index.html

Hi

I could think of 101 functions done side by side.

No easy answer to that.

Thanks for the help. Basically I wanted to move a specific based on the value of the key pressed. For example if you pressed the “B” key, the “B” would move to the mouse cursor location. I supposed I could just wire 26 letter key press events to trigger the same function while passing the Key press letter value to that function? I’m positive there is an easier way to do this in C++, but for this project I am trying to use blueprints for everything if possible.

try pasting this text into your player controller blueprint event graph, it will save you wiring all those nodes:

https://dl.dropboxusercontent.com/u/14534997/ControllerTyping3.txt

Hey Death,

It looks like Omnicypher provided you an easy way to implement c++ into your project. I know you had stated that you wish to use blueprints for this, but Omni’s method is likely going to save you a lot of .

Let me know if you have any further questions, have a great day! :slight_smile: