How to get key used for input?
Currently, I'm searching for the c++ equivalent of getting the key used for an input, like in this blueprint:
asked Jun 18 '16 at 03:09 PM in C++ Programming
This sort of behavior will require a bit more work on the C++ end. There's not a universal event that's emitted when a key is pressed.
In C++ you have a couple of options. You could monitor key presses within your player controllers Tick() function, checking WasInputKeyJustPressed(). You could also create a new InputComponent, which would allow you to better monitor input. Other than that, for keys you expect to be using, BindAction() will be your friend.
What are you trying to do that binding an input within Settings > Input isn't handling?
answered Jun 18 '16 at 06:39 PM
This behavior can be achieved by just adding an "FKey" parameter to the bound method.
Create an Action input mapping on the ProjectSettings, then add all the key binds you need (AnyKey if you want all keys). Then use it like this on your code:
You can use
Follow this question
Once you sign in you will be able to subscribe for any updates here