Can I keybind a console command?

Sorry for the dumb question, but is it possible to bind a key to a console command?

For example bind a key to “stat fps” so I don’t have to hit ‘~’ then type that command over and over, and instead just hit a hotkey like F11 or something.

If I make a custom console command, it would be nice to be able to bind those as well.

Alternatively, being able to add a button in the editor that calls the command would accomplish the same goal.

Is it possible?

Hello solariz783!

Try firing a key event, like the ‘f’ key, in your Player Controller and calling ‘Execute Console Command’ and giving the graph node your favorite command, such as ‘stat fps’.
This can be set up through blueprints, which makes it almost entirely painless.

Have fun!
Spiris

Thanks for the answer. Sometimes is hard to figure out how to go about searching for an answer (like what keywords to google or search in here).

This solution works great within a particular game, but if I want it to work across games, I would have to repeat my efforts for each game. Is there a way to extend to editor to make it work more universally? (in-game)

The simplest solution would be to set up a PlayerController with all the key binding you want it to have, and then simply make it the parent of however many games’ Player Controllers. Migrating the blueprint to wherever you needed it.
For example you would have a Player Controller, named something like 'DebugPlayerController", then a Debug Player Controller named something like “MyPlayerController”.
Then, when you wanted to remove the debug functionality, you would simply reparent MyPlayerController to have PlayerController as it’s parent.