# HG changeset patch # User Matti Hamalainen # Date 1290273262 -7200 # Node ID af32c038cf1e7c62b8df8740d1d46e06d58d354b # Parent b1482bc34260b4ebc77d00ac2e3a45bc37a5ffa8 Add some hardcoded translations for certain terminal keycodes that NCurses 4.x on Solaris didn't handle .. urgh. diff -r b1482bc34260 -r af32c038cf1e nnchat.c --- a/nnchat.c Sat Nov 20 12:21:22 2010 +0200 +++ b/nnchat.c Sat Nov 20 19:14:22 2010 +0200 @@ -1149,6 +1149,27 @@ printMsg("Unhandled ESC-O key sequence 0x%02x\n", c); break; } + } else + if (c == '[') { + c = wgetch(stdscr); + switch (c) { + case 0x32: c = KEY_IC; break; + case 0x33: c = KEY_DC; break; + + case 0x35: c = KEY_PPAGE; break; + case 0x36: c = KEY_NPAGE; break; + + case 0x37: c = KEY_HOME; break; + case 0x38: c = KEY_END; break; + + default: + printMsg("Unhandled ESC-[*~ key sequence 0x%02x\n", c); + c = ERR; + break; + } + /* Get the trailing ~ */ + if (c != ERR) + wgetch(stdscr); } else { printMsg("Unhandled ESC key sequence 0x%02x\n", c); continue; @@ -1251,6 +1272,7 @@ case KEY_BACKSPACE: case 0x08: + case 0x7f: nn_editbuf_delete(editBuf, editBuf->pos - 1); nn_editbuf_setpos(editBuf, editBuf->pos - 1); update = TRUE;