bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multi_key & ncurses


From: folkert
Subject: Multi_key & ncurses
Date: Thu, 14 Jun 2018 17:32:40 +0200
User-agent: NeoMutt/20170306 (1.8.0)

Hi,

I'm trying to enter multi-characters in an ncurses-application:

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[])
{
        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;
}


Folkert van Heusden

-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]