# HG changeset patch # User Mikael Berthe # Date 1142611924 -3600 # Node ID 402b0e288433411674570af3e05978dec028af2e # Parent ae23c8826efb8957abad8372a9e2eb01cfd9641b Enable "meta" key diff -r ae23c8826efb -r 402b0e288433 mcabber/src/screen.c --- a/mcabber/src/screen.c Tue Mar 14 12:43:23 2006 +0100 +++ b/mcabber/src/screen.c Fri Mar 17 17:12:04 2006 +0100 @@ -1824,16 +1824,38 @@ int scr_Getch(void) { - int ch; - ch = wgetch(inputWnd); - return ch; + return wgetch(inputWnd); } // process_key(key) // Handle the pressed key, in the command line (bottom). int process_key(int key) { - switch(key) { + if (key == 27) { + key = scr_Getch(); + if (key == -1 || key == 27) { + // This is a "real" escape... + scr_CheckAutoAway(TRUE); + currentWindow = NULL; + chatmode = FALSE; + if (current_buddy) + buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); + scr_RosterVisibility(1); + scr_UpdateChatStatus(FALSE); + top_panel(chatPanel); + top_panel(inputPanel); + update_panels(); + } else { // Meta + switch (key) { + default: + scr_LogPrint(LPRINT_NORMAL, "Unknown key=M%d", key); + } + } + key = -1; + } + switch (key) { + case -1: + break; case 8: // Ctrl-h case 127: // Backspace too case KEY_BACKSPACE: @@ -1952,18 +1974,6 @@ case 23: // Ctrl-w readline_backward_kill_word(); break; - case 27: // ESC - scr_CheckAutoAway(TRUE); - currentWindow = NULL; - chatmode = FALSE; - if (current_buddy) - buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); - scr_RosterVisibility(1); - scr_UpdateChatStatus(FALSE); - top_panel(chatPanel); - top_panel(inputPanel); - update_panels(); - break; case 12: // Ctrl-l scr_CheckAutoAway(TRUE); scr_Resize();