Call a Function on Input

Hey everyone,

What I want should be really easy, but for the life of me, I can’t find it. Basically, any time there is input from the player, no matter what key, button, mouse movement, joystick, etc. that it is, I want to call a function that looks at that input, determines if it came from a gamepad or not, and sets a bool accordingly. I have no clue how to do it in C++, and I can’t do it well in Blueprints (using Any Key during gameplay and On Key Down in widgets is not a reliable method). Can someone walk me through this for both C++ and Blueprints?

You guys are amazing!
-Tyler

Look at this video:

I have some problems related to the input… or something like that… I’m not sure.

Please, when you have finished it, can you tell me if it works well for you or if you also have problems… Thank you very much!!

Thank you, but this does not address my question. He’s talking about how to bind to a specific input, and it requires Blueprint to do. I need to detect any input, no matter what it is, and know if it was from a gamepad or not. I also need to be able to do it purely in C++ or Blueprint.

Ok, in C++ standard you must read the input buffer (called stdin) the concep is like read a file… i don’t know do it in Unreal, but i think you must change the name of your question… maybe something like this:

¿How to read the keyboard input buffer?..

i think is more apropiated.

But then I won’t be able to tell if it’s from a gamepad or not. I think my title is fine, but you do need to read the full post to fully understand what I’m trying to do.

The tool that unreal provides you is key/button mapping.

If you map the keys you know where the input comes from.

So the only way is to create an input action that has every single possible input mapped to it? That’s not very practical

it is a respectable opinion