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.54 by pcg, Sun Feb 22 12:58:02 2004 UTC vs.
Revision 1.55 by pcg, Sun Feb 22 20:08:18 2004 UTC

110 SET_LOCALE (locale); 110 SET_LOCALE (locale);
111 111
112 if (status_return == XLookupChars 112 if (status_return == XLookupChars
113 || status_return == XLookupBoth) 113 || status_return == XLookupBoth)
114 { 114 {
115 /* make sure the user can type ctrl-@, i.e. NUL */
116 if (len == 1 && *wkbuf == 0)
117 {
118 kbuf[0] = 0;
119 len = 1;
120 }
121 else
122 {
115 wkbuf[len] = 0; 123 wkbuf[len] = 0;
116 len = wcstombs ((char *)kbuf, wkbuf, KBUFSZ); 124 len = wcstombs ((char *)kbuf, wkbuf, KBUFSZ);
117 if (len < 0) 125 if (len < 0)
118 len = 0; 126 len = 0;
127 }
119 } 128 }
120 else 129 else
121 len = 0; 130 len = 0;
122 } 131 }
123 132
653 kbuf[len - 1] = (shft ? (ctrl ? '@' : '$') : (ctrl ? '^' : '~')); 662 kbuf[len - 1] = (shft ? (ctrl ? '@' : '$') : (ctrl ? '^' : '~'));
654 663
655 /* escape prefix */ 664 /* escape prefix */
656 if (meta 665 if (meta
657#ifdef META8_OPTION 666#ifdef META8_OPTION
658 && (meta_char == C0_ESC) 667 && meta_char == C0_ESC
659#endif 668#endif
660 ) 669 )
661 { 670 {
662 const unsigned char ch = C0_ESC; 671 const unsigned char ch = C0_ESC;
663
664 tt_write (&ch, 1); 672 tt_write (&ch, 1);
665 } 673 }
674
666#ifdef DEBUG_CMD 675#if defined(DEBUG_CMD)
667 if (debug_key)
668 { /* Display keyboard buffer contents */ 676 /* Display keyboard buffer contents */
669 char *p; 677 unsigned char *p;
670 int i; 678 int i;
671 679
672 fprintf (stderr, "key 0x%04X [%d]: `", (unsigned int)keysym, len); 680 fprintf (stderr, "key 0x%04X [%d]: `", (unsigned int)keysym, len);
673 for (i = 0, p = kbuf; i < len; i++, p++) 681 for (i = 0, p = kbuf; i < len; i++, p++)
674 fprintf (stderr, (*p >= ' ' && *p < '\177' ? "%c" : "\\%03o"), *p); 682 fprintf (stderr, (*p >= ' ' && *p < '\177' ? "%c" : "\\%03o"), *p);
675 fprintf (stderr, "'\n"); 683 fprintf (stderr, "'\n");
676 }
677#endif /* DEBUG_CMD */ 684#endif /* DEBUG_CMD */
678 tt_write (kbuf, (unsigned int)len); 685 tt_write (kbuf, (unsigned int)len);
679} 686}
680/*}}} */ 687/*}}} */
681 688

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines