Can I simulate a key press event in C++ or Blueprint?

My attempts :frowning: