How to Print text on the screen by pressing assigned key?

Hello, I have assigned the “C” key to crouch and I want to print the text on the screen “Crouch Successful” when the “C” key is pressed. I want to do it in C++.