LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Problem in getting key codes in curses (https://www.linuxquestions.org/questions/linux-general-1/problem-in-getting-key-codes-in-curses-314385/)

softking 04-18-2005 01:52 AM

Problem in getting key codes in curses
 
Hi,
i am writing a cli using curses in c++. There is simple loop

while ((ch = wgetch (this->win)) != KEY_ENTER) {
switch (ch)
{
case KEY_BACKSPACE:
wprintw (this->win, " inside baskspace");
break;
default:
wprintw (this->win, "(%d)%c", ch, ch);
break;
}
refresh ();
}

The problem is i get value 8 in ch when i press BACKSPACE. Even i am getting different value for the KEY_ENTER. :confused:

What could be the problem? How to solve it?


All times are GMT -5. The time now is 11:07 AM.