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.402 by ayin, Fri Feb 1 14:13:52 2008 UTC vs.
Revision 1.406 by ayin, Thu Feb 14 23:53:05 2008 UTC

302 302
303void 303void
304rxvt_term::key_press (XKeyEvent &ev) 304rxvt_term::key_press (XKeyEvent &ev)
305{ 305{
306 int ctrl, meta, shft, len; 306 int ctrl, meta, shft, len;
307 unsigned int newlen;
308 KeySym keysym; 307 KeySym keysym;
309 int valid_keysym; 308 int valid_keysym;
310 char kbuf[KBUFSZ]; 309 char kbuf[KBUFSZ];
311 310
312#if ISO_14755 311#if ISO_14755
547 } 546 }
548#endif 547#endif
549 548
550 if (keysym >= 0xFF00 && keysym <= 0xFFFF) 549 if (keysym >= 0xFF00 && keysym <= 0xFFFF)
551 { 550 {
552 {
553 bool kp = priv_modes & PrivMode_aplKP ? !shft : shft; 551 bool kp = priv_modes & PrivMode_aplKP ? !shft : shft;
554 newlen = 1; 552 unsigned int newlen = 1;
555#ifdef XK_KP_Home 553#ifdef XK_KP_Home
556 static const KeySym keypadtrans[] = { 554 static const KeySym keypadtrans[] = {
557 XK_KP_7, // XK_KP_Home 555 XK_KP_7, // XK_KP_Home
558 XK_KP_4, // XK_KP_Left 556 XK_KP_4, // XK_KP_Left
559 XK_KP_8, // XK_KP_Up 557 XK_KP_8, // XK_KP_Up
789 break; 787 break;
790 } 788 }
791 789
792 if (newlen) 790 if (newlen)
793 len = strlen (kbuf); 791 len = strlen (kbuf);
794 }
795 792
796 /* 793 /*
797 * Pass meta for all function keys, if 'meta' option set 794 * Pass meta for all function keys, if 'meta' option set
798 */ 795 */
799#ifdef META8_OPTION 796#ifdef META8_OPTION
1947 /* 1944 /*
1948 * Scrollbar window processing of button press 1945 * Scrollbar window processing of button press
1949 */ 1946 */
1950 if (scrollBar.state && ev.window == scrollBar.win) 1947 if (scrollBar.state && ev.window == scrollBar.win)
1951 { 1948 {
1952 int upordown = 0; 1949 page_dirn direction = NO_DIR;
1953 1950
1954 if (scrollBar.upButton (ev.y)) 1951 if (scrollBar.upButton (ev.y))
1955 upordown = -1; /* up */ 1952 direction = UP; /* up */
1956 else if (scrollBar.dnButton (ev.y)) 1953 else if (scrollBar.dnButton (ev.y))
1957 upordown = 1; /* down */ 1954 direction = DN; /* down */
1958 1955
1959 scrollBar.state = STATE_IDLE; 1956 scrollBar.state = STATE_IDLE;
1960 /* 1957 /*
1961 * Rxvt-style scrollbar: 1958 * Rxvt-style scrollbar:
1962 * move up if mouse is above slider 1959 * move up if mouse is above slider
1973 /* 1970 /*
1974 * Mouse report disabled scrollbar: 1971 * Mouse report disabled scrollbar:
1975 * arrow buttons - send up/down 1972 * arrow buttons - send up/down
1976 * click on scrollbar - send pageup/down 1973 * click on scrollbar - send pageup/down
1977 */ 1974 */
1978 if (upordown < 0) 1975 if (direction == UP)
1979 tt_printf ("\033[A"); 1976 tt_printf ("\033[A");
1980 else if (upordown > 0) 1977 else if (direction == DN)
1981 tt_printf ("\033[B"); 1978 tt_printf ("\033[B");
1982 else 1979 else
1983 switch (ev.button) 1980 switch (ev.button)
1984 { 1981 {
1985 case Button2: 1982 case Button2:
1993 break; 1990 break;
1994 } 1991 }
1995 } 1992 }
1996 else 1993 else
1997#endif /* NO_SCROLLBAR_REPORT */ 1994#endif /* NO_SCROLLBAR_REPORT */
1998
1999 { 1995 {
2000 if (upordown) 1996 if (direction != NO_DIR)
2001 { 1997 {
2002#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1998#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
2003 if (!cont_scroll_ev.is_active ()) 1999 if (!cont_scroll_ev.is_active ())
2004 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2000 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2005#endif 2001#endif
2006 if (scr_page (upordown < 0 ? UP : DN, 1)) 2002 if (scr_page (direction, 1))
2007 { 2003 {
2008 if (upordown < 0) 2004 if (direction == UP)
2009 scrollBar.state = STATE_UP; 2005 scrollBar.state = STATE_UP;
2010 else 2006 else
2011 scrollBar.state = STATE_DOWN; 2007 scrollBar.state = STATE_DOWN;
2012 } 2008 }
2013 } 2009 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines