--- rxvt-unicode/src/command.C 2004/12/15 05:39:08 1.179 +++ rxvt-unicode/src/command.C 2004/12/21 06:43:00 1.183 @@ -50,8 +50,8 @@ #include "version.h" #include "command.h" -#include -#include +#include +#include /*----------------------------------------------------------------------*/ @@ -490,7 +490,7 @@ if (keysym >= 0xFF00 && keysym <= 0xFFFF) { #ifdef KEYSYM_RESOURCE - if (! (shft | ctrl) && Keysym_map[keysym & 0xFF] != NULL) + if (!(shft | ctrl) && Keysym_map[keysym & 0xFF] != NULL) { unsigned int l; const unsigned char *kbuf0; @@ -787,9 +787,13 @@ break; #undef FKEY default: - newlen = 0; - break; + if (len == 0 + && (keysym & 0xfff0) != 0xff70 + && (keysym & 0xfff0) != 0xffe0) + /* generate a keycode for every remaining keypress */ + sprintf ((char *)kbuf, "\033[%x;%xA", (unsigned char)ev.state, (unsigned short)keysym); } + if (newlen) len = strlen (kbuf); } @@ -808,6 +812,18 @@ len = 1; kbuf[0] = '\037'; /* Ctrl-Minus generates ^_ (31) */ } + else if (keysym == XK_ISO_Left_Tab) + { + strcpy (kbuf, "\033[Z"); + len = 3; + } + else if (len == 0 + && (keysym & 0xffe0) != 0xfe00 + && (keysym < 0xfe50 || keysym > 0xfe6f)) + { + /* generate a keycode for every remaining keypress */ + len = sprintf ((char *)kbuf, "\033[%x;%xA", (unsigned char)ev.state, (unsigned short)keysym); + } else { #ifdef META8_OPTION @@ -2709,7 +2725,7 @@ // assume wchar == unicode cmdbuf_ptr += len; - return wc; + return wc & UNICODE_MASK; } return NOCHAR;