The best way I can think of is getch(); from #include<conio.h> header file. You can make a program to find out what number go's to each letter on your keyboard, and then program away.
If you put it in a loop, you can keep scanning for keyboard input and once it is whatever i is, you can display your message.
For context, you just assign it to a variable and the input is saved to that variable.