Mercurial > ~mikael > mcabber > hg
diff mcabber/src/main.c @ 761:4532a9fe0e8c
Handle some keyboard escape sequences
Some sequences are not caught by ncurses, so I've made a basic escape
sequences interpreter.
The patch defines a few sequences for xterm and Gnome terminal (ctrl-arrows).
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 19 Mar 2006 12:41:46 +0100 |
parents | ee03b56b93ee |
children | 464be13343a9 |
line wrap: on
line diff
--- a/mcabber/src/main.c Fri Mar 17 17:17:21 2006 +0100 +++ b/mcabber/src/main.c Sun Mar 19 12:41:46 2006 +0100 @@ -191,6 +191,7 @@ unsigned int ping; int ret; unsigned int refresh = 0; + keycode kcode; credits(); @@ -271,7 +272,8 @@ scr_LogPrint(LPRINT_DEBUG, "Entering into main loop..."); for (ret = 0 ; ret != 255 ; ) { - key = scr_Getch(); + scr_Getch(&kcode); + key = kcode.value; /* The refresh is really an ugly hack, but we need to call doupdate() from time to time to catch the RESIZE events, because getch keep @@ -279,7 +281,7 @@ However, it allows us to handle an autoaway check here... */ if (key != ERR) { - ret = process_key(key); + ret = process_key(kcode); refresh = 0; } else if (refresh++ > 1) { doupdate();