saai
10-15-2000, 01:20 PM
I am having trouble detecting when the enter key is pressed.
here is my current code:
nodelay();
nocbreak();
keypad(stdscr, TRUE);
int key = wgetch(stdscr);
if(key == KEY_ENTER
//do something
But, for some reason, the if statement is not succeeding. I have tried replacing KEY_ENTER with '\n', but with the same results. I would appreciate it if someone could help me out with this.
Thanks,
Saai
here is my current code:
nodelay();
nocbreak();
keypad(stdscr, TRUE);
int key = wgetch(stdscr);
if(key == KEY_ENTER
//do something
But, for some reason, the if statement is not succeeding. I have tried replacing KEY_ENTER with '\n', but with the same results. I would appreciate it if someone could help me out with this.
Thanks,
Saai