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.177 by root, Mon Dec 13 07:18:52 2004 UTC vs.
Revision 1.183 by root, Tue Dec 21 06:43:00 2004 UTC

48#include "../config.h" /* NECESSARY */ 48#include "../config.h" /* NECESSARY */
49#include "rxvt.h" /* NECESSARY */ 49#include "rxvt.h" /* NECESSARY */
50#include "version.h" 50#include "version.h"
51#include "command.h" 51#include "command.h"
52 52
53#include <wchar.h> 53#include <cwchar>
54#include <signal.h> 54#include <csignal>
55 55
56/*----------------------------------------------------------------------*/ 56/*----------------------------------------------------------------------*/
57 57
58#define IS_CONTROL(ch) !((ch) & 0xffffff60UL) 58#define IS_CONTROL(ch) !((ch) & 0xffffff60UL)
59 59
488#endif 488#endif
489 489
490 if (keysym >= 0xFF00 && keysym <= 0xFFFF) 490 if (keysym >= 0xFF00 && keysym <= 0xFFFF)
491 { 491 {
492#ifdef KEYSYM_RESOURCE 492#ifdef KEYSYM_RESOURCE
493 if (! (shft | ctrl) && Keysym_map[keysym & 0xFF] != NULL) 493 if (!(shft | ctrl) && Keysym_map[keysym & 0xFF] != NULL)
494 { 494 {
495 unsigned int l; 495 unsigned int l;
496 const unsigned char *kbuf0; 496 const unsigned char *kbuf0;
497 497
498 kbuf0 = (Keysym_map[keysym & 0xFF]); 498 kbuf0 = (Keysym_map[keysym & 0xFF]);
785 case XK_F35: /* "\033[49~" */ 785 case XK_F35: /* "\033[49~" */
786 FKEY (31, XK_F17); 786 FKEY (31, XK_F17);
787 break; 787 break;
788#undef FKEY 788#undef FKEY
789 default: 789 default:
790 newlen = 0; 790 if (len == 0
791 break; 791 && (keysym & 0xfff0) != 0xff70
792 && (keysym & 0xfff0) != 0xffe0)
793 /* generate a keycode for every remaining keypress */
794 sprintf ((char *)kbuf, "\033[%x;%xA", (unsigned char)ev.state, (unsigned short)keysym);
792 } 795 }
796
793 if (newlen) 797 if (newlen)
794 len = strlen (kbuf); 798 len = strlen (kbuf);
795 } 799 }
796 800
797 /* 801 /*
805 } 809 }
806 else if (ctrl && keysym == XK_minus) 810 else if (ctrl && keysym == XK_minus)
807 { 811 {
808 len = 1; 812 len = 1;
809 kbuf[0] = '\037'; /* Ctrl-Minus generates ^_ (31) */ 813 kbuf[0] = '\037'; /* Ctrl-Minus generates ^_ (31) */
814 }
815 else if (keysym == XK_ISO_Left_Tab)
816 {
817 strcpy (kbuf, "\033[Z");
818 len = 3;
819 }
820 else if (len == 0
821 && (keysym & 0xffe0) != 0xfe00
822 && (keysym < 0xfe50 || keysym > 0xfe6f))
823 {
824 /* generate a keycode for every remaining keypress */
825 len = sprintf ((char *)kbuf, "\033[%x;%xA", (unsigned char)ev.state, (unsigned short)keysym);
810 } 826 }
811 else 827 else
812 { 828 {
813#ifdef META8_OPTION 829#ifdef META8_OPTION
814 /* set 8-bit on */ 830 /* set 8-bit on */
1668 case PropertyNotify: 1684 case PropertyNotify:
1669 /* 1685 /*
1670 * if user used some Esetroot compatible prog to set the root bg, 1686 * if user used some Esetroot compatible prog to set the root bg,
1671 * use the property to determine the pixmap. We use it later on. 1687 * use the property to determine the pixmap. We use it later on.
1672 */ 1688 */
1673 if (xa[XA_XROOTPMAPID] == 0)
1674 xa[XA_XROOTPMAPID] = XInternAtom (display->display, "_XROOTPMAP_ID", False);
1675
1676 if (ev.xproperty.atom != xa[XA_XROOTPMAPID]) 1689 if (ev.xproperty.atom != xa[XA_XROOTPMAP_ID]
1690 && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID])
1677 return; 1691 return;
1678 1692
1679 /* FALLTHROUGH */ 1693 /* FALLTHROUGH */
1680 case ReparentNotify: 1694 case ReparentNotify:
1681 if ((options & Opt_transparent) && check_our_parents () && am_transparent) 1695 if ((options & Opt_transparent) && check_our_parents () && am_transparent)
2351 /* 2365 /*
2352 * Make the frame window set by the window manager have 2366 * Make the frame window set by the window manager have
2353 * the root background. Some window managers put multiple nested frame 2367 * the root background. Some window managers put multiple nested frame
2354 * windows for each client, so we have to take care about that. 2368 * windows for each client, so we have to take care about that.
2355 */ 2369 */
2356 i = (xa[XA_XROOTPMAPID] 2370 i = (xa[XA_XROOTPMAP_ID]
2357 && XGetWindowProperty (display->display, display->root, xa[XA_XROOTPMAPID], 2371 && XGetWindowProperty (display->display, display->root, xa[XA_XROOTPMAP_ID],
2358 0L, 1L, False, XA_PIXMAP, &atype, &aformat, 2372 0L, 1L, False, XA_PIXMAP, &atype, &aformat,
2359 &nitems, &bytes_after, &prop) == Success); 2373 &nitems, &bytes_after, &prop) == Success);
2360 2374
2361 if (!i || prop == NULL) 2375 if (!i || prop == NULL)
2362 i = (xa[XA_XSETROOTID] 2376 i = (xa[XA_ESETROOT_PMAP_ID]
2363 && XGetWindowProperty (display->display, display->root, xa[XA_XSETROOTID], 2377 && XGetWindowProperty (display->display, display->root, xa[XA_ESETROOT_PMAP_ID],
2364 0L, 1L, False, XA_PIXMAP, &atype, &aformat, 2378 0L, 1L, False, XA_PIXMAP, &atype, &aformat,
2365 &nitems, &bytes_after, &prop) == Success); 2379 &nitems, &bytes_after, &prop) == Success);
2366 2380
2367 if (!i || prop == NULL 2381 if (!i || prop == NULL
2368#if TINTING 2382#if TINTING
2709 if (len == (size_t)-1) 2723 if (len == (size_t)-1)
2710 return *cmdbuf_ptr++; // the _occasional_ latin1 character is allowed to slip through 2724 return *cmdbuf_ptr++; // the _occasional_ latin1 character is allowed to slip through
2711 2725
2712 // assume wchar == unicode 2726 // assume wchar == unicode
2713 cmdbuf_ptr += len; 2727 cmdbuf_ptr += len;
2714 return wc; 2728 return wc & UNICODE_MASK;
2715 } 2729 }
2716 2730
2717 return NOCHAR; 2731 return NOCHAR;
2718} 2732}
2719 2733

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines