How to determine what key is pressed? Return key name or display name? c++

I know there are anykey nodes in the blueprint. How to implement it in C + +?