# HG changeset patch # User Matti Hamalainen # Date 1229159959 -7200 # Node ID e8c9d7d13866b69f4900fdc809c6e56fc4fe1fc3 # Parent 162951c382b86cbd5a556c908090da3a9227f014 Handle certain key sequences better. diff -r 162951c382b8 -r e8c9d7d13866 nnchat.c --- a/nnchat.c Sun Nov 16 14:02:18 2008 +0200 +++ b/nnchat.c Sat Dec 13 11:19:19 2008 +0200 @@ -619,7 +619,7 @@ memset(histBuf, 0, sizeof(histBuf)); /* Initialize */ - th_init("NNChat", "Newbie Nudes chat client", "0.6.5", + th_init("NNChat", "Newbie Nudes chat client", "0.6.6", "Written and designed by Anonymous Finnish Guy (C) 2008", "This software is freeware, use and distribute as you wish."); th_verbosityLevel = 0; @@ -814,6 +814,24 @@ /* Handle several buffered keypresses at once */ do { c = wgetch(stdscr); + + if (c == 0x1b) { + c = wgetch(stdscr); + if (c == 'O') { + c = wgetch(stdscr); + switch (c) { + case 'd': c = 0x204; break; + case 'c': c = 0x206; break; + default: + printMsg("Unhandled ESC-O key sequence 0x%02x\n", c); + break; + } + } else { + printMsg("Unhandled ESC key sequence 0x%02x\n", c); + continue; + } + } + switch (c) { #ifdef KEY_RESIZE case KEY_RESIZE: @@ -957,7 +975,7 @@ setBufPos(editBuf, editBuf->pos + 1); update = TRUE; } else { - printMsg("Unhandled key: %02x\n", c); + printMsg("Unhandled key: 0x%02x\n", c); } break; }