you can use
#include <conio.h>
and then catch char with cases like
char c; if (_kbhit()) { c = getch(); switch(c) { case '\0H' : cout << "up arrow key!" << endl; break; } }
Beware : I have not tried ... and remember to put it all on "while (true)" to test.
source share