How to get Key in C++?

OK here’s my idea:

First grab a list of all possible keys and store it using EKeys::GetAllKeys which take a reference to a TArray. Now you have all possible keys.

Now, each time you want to check for your Any Key, you loop through the array and call IsInputKeyDown and when you get a true you can respond to it knowing exactly which FKey was pressed. FKey has some helper functions to help determine what type of key it is. FKey is declared in InputCoreTypes.h.

1 Like