what is the key code for space bar in curses.h

wenincode picture wenincode · Nov 17, 2012 · Viewed 22.5k times · Source

I just have a simple question, I cannot find what the key code is for space bar in curses.h. ex. I know the code for down is KEY_DOWN. can anyone help?

Answer

John Vulconshinz picture John Vulconshinz · Nov 17, 2012

There is no macro for the space key. Just use ' ' to represent a space. You can find a complete list of curses key macros here.

Ex.

char mychar = ' ';
if (mychar == ' ') {//Do this...}