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.498 by sf-exg, Fri Sep 30 13:31:21 2011 UTC vs.
Revision 1.505 by sf-exg, Thu Jan 19 13:33:43 2012 UTC

54 54
55#ifdef KEYSYM_RESOURCE 55#ifdef KEYSYM_RESOURCE
56# include "keyboard.h" 56# include "keyboard.h"
57#endif 57#endif
58 58
59#include <csignal> 59#include <signal.h>
60 60
61#if LINUX_YIELD_HACK 61#if LINUX_YIELD_HACK
62# include <ctime> 62# include <time.h>
63#endif 63#endif
64 64
65/*----------------------------------------------------------------------*/ 65/*----------------------------------------------------------------------*/
66 66
67#define IS_CONTROL(ch) !((ch) & 0xffffff60UL) 67#define IS_CONTROL(ch) !((ch) & 0xffffff60UL)
776 } 776 }
777 777
778 if (newlen) 778 if (newlen)
779 len = strlen (kbuf); 779 len = strlen (kbuf);
780 780
781 if (len > 0)
782 {
781 /* 783 /*
784 * pass Shift/Control indicators for function keys ending with `~'
785 *
786 * eg,
787 * Prior = "ESC[5~"
788 * Shift+Prior = "ESC[5$"
789 * Ctrl+Prior = "ESC[5^"
790 * Ctrl+Shift+Prior = "ESC[5@"
791 */
792 if (kbuf[0] == C0_ESC && kbuf[1] == '[' && kbuf[len - 1] == '~')
793 kbuf[len - 1] = (shft ? (ctrl ? '@' : '$') : (ctrl ? '^' : '~'));
794
795 /*
782 * Pass meta for all function keys, if 'meta' option set 796 * Pass meta for all function keys, if 'meta' option set
783 */ 797 */
784#ifdef META8_OPTION 798#ifdef META8_OPTION
785 if (meta && (meta_char == 0x80) && len > 0) 799 if (meta && (meta_char == 0x80))
786 kbuf[len - 1] |= 0x80; 800 kbuf[len - 1] |= 0x80;
787#endif 801#endif
802 }
788 803
789 } 804 }
790 else if (ctrl && keysym == XK_minus) 805 else if (ctrl && keysym == XK_minus)
791 { 806 {
792 len = 1; 807 len = 1;
825 if (view_start) 840 if (view_start)
826 { 841 {
827 view_start = 0; 842 view_start = 0;
828 want_refresh = 1; 843 want_refresh = 1;
829 } 844 }
830
831 /*
832 * these modifications only affect the static keybuffer
833 * pass Shift/Control indicators for function keys ending with `~'
834 *
835 * eg,
836 * Prior = "ESC[5~"
837 * Shift+Prior = "ESC[5$"
838 * Ctrl+Prior = "ESC[5^"
839 * Ctrl+Shift+Prior = "ESC[5@"
840 * Meta adds an Escape prefix (with META8_OPTION, if meta == <escape>).
841 */
842 if (kbuf[0] == C0_ESC && kbuf[1] == '[' && kbuf[len - 1] == '~')
843 kbuf[len - 1] = (shft ? (ctrl ? '@' : '$') : (ctrl ? '^' : '~'));
844 845
845 /* escape prefix */ 846 /* escape prefix */
846 if (meta 847 if (meta
847#ifdef META8_OPTION 848#ifdef META8_OPTION
848 && meta_char == C0_ESC 849 && meta_char == C0_ESC
1633 dist = int_bwidth - ev.xbutton.y; 1634 dist = int_bwidth - ev.xbutton.y;
1634 } 1635 }
1635 else 1636 else
1636 { 1637 {
1637 scroll_selection_dir = DN; 1638 scroll_selection_dir = DN;
1638 dist = ev.xbutton.y - (int_bwidth + height); 1639 dist = ev.xbutton.y - (int_bwidth + vt_height);
1639 } 1640 }
1640 1641
1641 scroll_selection_lines = Pixel2Height (dist) 1642 scroll_selection_lines = Pixel2Height (dist)
1642 / SELECTION_SCROLL_LINE_SPEEDUP 1643 / SELECTION_SCROLL_LINE_SPEEDUP
1643 + 1; 1644 + 1;
2162 case Button3: 2163 case Button3:
2163 selection_make (ev.time); 2164 selection_make (ev.time);
2164 break; 2165 break;
2165 2166
2166 case Button2: 2167 case Button2:
2167 if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? 2168 if (IN_RANGE_EXC (ev.x, 0, vt_width) && IN_RANGE_EXC (ev.y, 0, vt_height)) // inside window?
2168 selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); 2169 selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary);
2169 break; 2170 break;
2170 2171
2171#ifdef MOUSE_WHEEL 2172#ifdef MOUSE_WHEEL
2172 case Button4: 2173 case Button4:
2886 } 2887 }
2887 break; 2888 break;
2888#endif 2889#endif
2889 2890
2890 case CSI_CUU: /* 8.3.22: (1) CURSOR UP */ 2891 case CSI_CUU: /* 8.3.22: (1) CURSOR UP */
2891 case CSI_VPR: /* 8.3.161: (1) LINE POSITION FORWARD */ 2892 case CSI_VPB: /* 8.3.160: (1) LINE POSITION BACKWARD */
2892 arg[0] = -arg[0]; 2893 arg[0] = -arg[0];
2893 /* FALLTHROUGH */ 2894 /* FALLTHROUGH */
2894 case CSI_CUD: /* 8.3.19: (1) CURSOR DOWN */ 2895 case CSI_CUD: /* 8.3.19: (1) CURSOR DOWN */
2895 case CSI_VPB: /* 8.3.160: (1) LINE POSITION BACKWARD */ 2896 case CSI_VPR: /* 8.3.161: (1) LINE POSITION FORWARD */
2896 scr_gotorc (arg[0], 0, RELATIVE); 2897 scr_gotorc (arg[0], 0, RELATIVE);
2897 break; 2898 break;
2898 2899
2899 case CSI_CUB: /* 8.3.18: (1) CURSOR LEFT */ 2900 case CSI_CUB: /* 8.3.18: (1) CURSOR LEFT */
2900 case CSI_HPB: /* 8.3.59: (1) CHARACTER POSITION BACKWARD */ 2901 case CSI_HPB: /* 8.3.59: (1) CHARACTER POSITION BACKWARD */
3133 break; 3134 break;
3134 3135
3135 //case 9: NYI, TODO, restore maximized window or maximize window 3136 //case 9: NYI, TODO, restore maximized window or maximize window
3136 default: 3137 default:
3137 if (args[0] >= 24) /* set height (chars) */ 3138 if (args[0] >= 24) /* set height (chars) */
3138 set_widthheight ((unsigned int)width, 3139 set_widthheight ((unsigned int)vt_width,
3139 (unsigned int) (args[1] * fheight)); 3140 (unsigned int) (args[1] * fheight));
3140 break; 3141 break;
3141 3142
3142 /* 3143 /*
3143 * reports - some output format copied from XTerm 3144 * reports - some output format copied from XTerm

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines