ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.280 by root, Mon Jan 23 23:33:58 2006 UTC vs.
Revision 1.283 by root, Tue Jan 24 19:40:12 2006 UTC

299rxvt_term::lookup_key (XKeyEvent &ev) 299rxvt_term::lookup_key (XKeyEvent &ev)
300{ 300{
301 int ctrl, meta, shft, len; 301 int ctrl, meta, shft, len;
302 unsigned int newlen; 302 unsigned int newlen;
303 KeySym keysym; 303 KeySym keysym;
304#ifdef DEBUG_CMD
305 static int debug_key = 1; /* accessible by a debugger only */
306#endif
307 int valid_keysym; 304 int valid_keysym;
308 char kbuf[KBUFSZ]; 305 char kbuf[KBUFSZ];
309 306
310 /* 307 /*
311 * use Num_Lock to toggle Keypad on/off. If Num_Lock is off, allow an 308 * use Num_Lock to toggle Keypad on/off. If Num_Lock is off, allow an
902 { 899 {
903 const char ch = C0_ESC; 900 const char ch = C0_ESC;
904 tt_write (&ch, 1); 901 tt_write (&ch, 1);
905 } 902 }
906 903
907#if defined(DEBUG_CMD)
908 /* Display keyboard buffer contents */
909 unsigned char *p;
910 int i;
911
912 fprintf (stderr, "key 0x%04X [%d]: `", (unsigned int)keysym, len);
913 for (i = 0, p = kbuf; i < len; i++, p++)
914 fprintf (stderr, (*p >= ' ' && *p < '\177' ? "%c" : "\\%03o"), *p);
915 fprintf (stderr, "'\n");
916#endif /* DEBUG_CMD */
917 tt_write (kbuf, (unsigned int)len); 904 tt_write (kbuf, (unsigned int)len);
918} 905}
919/*}}} */ 906/*}}} */
920 907
921#if defined (KEYSYM_RESOURCE) 908#if defined (KEYSYM_RESOURCE)
2142 selection_make (ev.time); 2129 selection_make (ev.time);
2143 break; 2130 break;
2144 2131
2145 case Button2: 2132 case Button2:
2146 if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? 2133 if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window?
2147 selection_request (ev.time, ev.state & ShiftMask ? Sel_Clipboard : Sel_Primary); 2134 selection_request (ev.time, ev.state & ModMetaMask ? Sel_Primary : Sel_Primary);
2148 break; 2135 break;
2149 2136
2150#ifdef MOUSE_WHEEL 2137#ifdef MOUSE_WHEEL
2151 case Button4: 2138 case Button4:
2152 case Button5: 2139 case Button5:
3292 ndef = get_byte_array_bit (csi_defaults, i); 3279 ndef = get_byte_array_bit (csi_defaults, i);
3293 for (p = 0; p < nargs; p++) 3280 for (p = 0; p < nargs; p++)
3294 if (arg[p] == -1) 3281 if (arg[p] == -1)
3295 arg[p] = ndef; 3282 arg[p] = ndef;
3296 3283
3297#ifdef DEBUG_CMD
3298 fprintf (stderr, "CSI ");
3299 for (p = 0; p < nargs; p++)
3300 fprintf (stderr, "%d%s", arg[p], p < nargs - 1 ? ";" : "");
3301 fprintf (stderr, "%c\n", ch);
3302#endif
3303
3304 /* 3284 /*
3305 * private mode handling 3285 * private mode handling
3306 */ 3286 */
3307 if (priv) 3287 if (priv)
3308 { 3288 {
3309 switch (priv) 3289 switch (priv)
3310 { 3290 {
3311 case '>': 3291 case '>':
3312 if (ch == CSI_DA) /* secondary device attributes */ 3292 if (ch == CSI_DA) /* secondary device attributes */
3293 {
3294 // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt,
3295 // 'U' for rxvt-unicode <= 7.2, and Mm85 (e.g. 7385 for 7.3) for later versions.
3296 //
3297 // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt
3298 // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify
3299 // that we do not support xterm mouse reporting (should be 95 when we do).
3300 //
3313 tt_printf ("\033[>%d;%c%c;0c", 'U', VERSION[0], VERSION[2]); 3301 tt_printf ("\033[>%c%c85;94;0c", VERSION[0], VERSION[1]);
3302 }
3314 break; 3303 break;
3315 case '?': 3304 case '?':
3316 if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') 3305 if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't')
3317 process_terminal_mode (ch, priv, nargs, arg); 3306 process_terminal_mode (ch, priv, nargs, arg);
3318 break; 3307 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines