Search code examples
c++unicodencursesgetchwidechar

Window for taking getch input not showing using ncursesw but works with ncurses


I need to use -lncursesw to print out unicode characters otherwise it wouldn't work however after compiling it with this, the window for user input shows up but when I type characters to it, it doesn't show but still able to type. I honestly don't know how to make this work, I have set the locale with setlocale(LC_ALL, "");

this is the code for input:

while ((ch = getch()) != KEY_F(9)) driver(ch);

and an example piece of code for handling the input (using switch cases) this is the default:

    default:
        form_driver(commandForm, ch);
        showGrid();
        wrefresh(mainScreen);
        break;

This is what it looks like, the first picture using -lncursesw and second using -lncurses.

This is using -lncursesw

This is using -lncurses


Solution

  • Instead of using -lform, use -lformw.