I'm trying to enter multi-characters in an ncurses-application (e.g. accents, special characters):
I enter before that in the terminal: xmodmap -e "keycode 66 = Multi_key" and then: capslock e = (these 3 keys) gives an euro sign: € <- there you should see an euro sign, see https://en.wikipedia.org/wiki/Euro_sign
In the ncurses application I get garbage or the terminal seems to hang - I then need to press a couple of keys to-unhang it often that does not work.
#include <ncursesw/curses.h>
int main(int argc, char *argv[])
{
setlocale(LC_ALL,"");
initscr();
start_color();
use_default_colors();
keypad(stdscr, TRUE);
cbreak();
intrflush(stdscr, FALSE);
noecho();
refresh();
nodelay(stdscr, FALSE);
meta(stdscr, TRUE); /* enable 8-bit input */
raw(); /* to be able to catch ctrl+c */
leaveok(stdscr, TRUE);
for(;;) {
wint_t ch;
if (get_wch(&ch) != ERR) {
wchar_t temp[] = { ch, 0x00 };
addwstr(temp);
}
else {
addwstr(L" {ERR} ");
}
refresh();
}
return 0;
}
Any ideas?