[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multi_key & ncurses
From: |
Thomas Dickey |
Subject: |
Re: Multi_key & ncurses |
Date: |
Sat, 16 Jun 2018 15:15:06 -0400 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Thu, Jun 14, 2018 at 05:32:40PM +0200, folkert wrote:
> 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
Something's amiss there. Euro is U+20AC, which doesn't match the characters
in your message. This is Euro: "€".
> 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[])
> {
You left out
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;
> }
>
>
> Folkert van Heusden
>
> --
>
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-ncurses
--
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: Digital signature