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.400 by ayin, Mon Jan 28 12:54:47 2008 UTC vs.
Revision 1.405 by ayin, Thu Feb 14 23:51:46 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
549 548
550 if (keysym >= 0xFF00 && keysym <= 0xFFFF) 549 if (keysym >= 0xFF00 && keysym <= 0xFFFF)
551 { 550 {
552 { 551 {
553 bool kp = priv_modes & PrivMode_aplKP ? !shft : shft; 552 bool kp = priv_modes & PrivMode_aplKP ? !shft : shft;
554 newlen = 1; 553 unsigned int newlen = 1;
555#ifdef XK_KP_Home 554#ifdef XK_KP_Home
556 static const KeySym keypadtrans[] = { 555 static const KeySym keypadtrans[] = {
557 XK_KP_7, // XK_KP_Home 556 XK_KP_7, // XK_KP_Home
558 XK_KP_4, // XK_KP_Left 557 XK_KP_4, // XK_KP_Left
559 XK_KP_8, // XK_KP_Up 558 XK_KP_8, // XK_KP_Up
1090 1089
1091#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1090#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
1092void 1091void
1093rxvt_term::cont_scroll_cb (ev::timer &w, int revents) 1092rxvt_term::cont_scroll_cb (ev::timer &w, int revents)
1094{ 1093{
1095 if ((scrollbar_isUp () || scrollbar_isDn ()) 1094 if ((scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN)
1096 && scr_page (scrollbar_isUp () ? UP : DN, 1)) 1095 && scr_page (scrollBar.state == STATE_UP ? UP : DN, 1))
1097 { 1096 {
1098 want_refresh = 1; 1097 want_refresh = 1;
1099 refresh_check (); 1098 refresh_check ();
1100 } 1099 }
1101 else 1100 else
1553 while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event)) 1552 while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event))
1554 ; 1553 ;
1555 1554
1556 if (scrollBar.state && ev.xany.window == scrollBar.win) 1555 if (scrollBar.state && ev.xany.window == scrollBar.win)
1557 { 1556 {
1558 scrollBar.setIdle (); 1557 scrollBar.state = STATE_IDLE;
1559 scrollbar_show (0); 1558 scrollbar_show (0);
1560 } 1559 }
1561 } 1560 }
1562 break; 1561 break;
1563 1562
1651#ifdef MOUSE_THRESHOLD 1650#ifdef MOUSE_THRESHOLD
1652 } 1651 }
1653#endif 1652#endif
1654 } 1653 }
1655 } 1654 }
1656 else if (scrollbar_isMotion () && ev.xany.window == scrollBar.win) 1655 else if (scrollBar.state == STATE_MOTION && ev.xany.window == scrollBar.win)
1657 { 1656 {
1658 while (XCheckTypedWindowEvent (dpy, scrollBar.win, 1657 while (XCheckTypedWindowEvent (dpy, scrollBar.win,
1659 MotionNotify, &ev)) 1658 MotionNotify, &ev))
1660 ; 1659 ;
1661 1660
1947 /* 1946 /*
1948 * Scrollbar window processing of button press 1947 * Scrollbar window processing of button press
1949 */ 1948 */
1950 if (scrollBar.state && ev.window == scrollBar.win) 1949 if (scrollBar.state && ev.window == scrollBar.win)
1951 { 1950 {
1952 int upordown = 0; 1951 page_dirn direction = NO_DIR;
1953 1952
1954 if (scrollBar.upButton (ev.y)) 1953 if (scrollBar.upButton (ev.y))
1955 upordown = -1; /* up */ 1954 direction = UP; /* up */
1956 else if (scrollBar.dnButton (ev.y)) 1955 else if (scrollBar.dnButton (ev.y))
1957 upordown = 1; /* down */ 1956 direction = DN; /* down */
1958 1957
1959 scrollBar.setIdle (); 1958 scrollBar.state = STATE_IDLE;
1960 /* 1959 /*
1961 * Rxvt-style scrollbar: 1960 * Rxvt-style scrollbar:
1962 * move up if mouse is above slider 1961 * move up if mouse is above slider
1963 * move dn if mouse is below slider 1962 * move dn if mouse is below slider
1964 * 1963 *
1973 /* 1972 /*
1974 * Mouse report disabled scrollbar: 1973 * Mouse report disabled scrollbar:
1975 * arrow buttons - send up/down 1974 * arrow buttons - send up/down
1976 * click on scrollbar - send pageup/down 1975 * click on scrollbar - send pageup/down
1977 */ 1976 */
1978 if (upordown < 0) 1977 if (direction == UP)
1979 tt_printf ("\033[A"); 1978 tt_printf ("\033[A");
1980 else if (upordown > 0) 1979 else if (direction == DN)
1981 tt_printf ("\033[B"); 1980 tt_printf ("\033[B");
1982 else 1981 else
1983 switch (ev.button) 1982 switch (ev.button)
1984 { 1983 {
1985 case Button2: 1984 case Button2:
1993 break; 1992 break;
1994 } 1993 }
1995 } 1994 }
1996 else 1995 else
1997#endif /* NO_SCROLLBAR_REPORT */ 1996#endif /* NO_SCROLLBAR_REPORT */
1998
1999 { 1997 {
2000 if (upordown) 1998 if (direction != NO_DIR)
2001 { 1999 {
2002#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 2000#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
2003 if (!cont_scroll_ev.is_active ()) 2001 if (!cont_scroll_ev.is_active ())
2004 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2002 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2005#endif 2003#endif
2006 if (scr_page (upordown < 0 ? UP : DN, 1)) 2004 if (scr_page (direction, 1))
2007 { 2005 {
2008 if (upordown < 0) 2006 if (direction == UP)
2009 scrollBar.setUp (); 2007 scrollBar.state = STATE_UP;
2010 else 2008 else
2011 scrollBar.setDn (); 2009 scrollBar.state = STATE_DOWN;
2012 } 2010 }
2013 } 2011 }
2014 else 2012 else
2015 switch (ev.button) 2013 switch (ev.button)
2016 { 2014 {
2031 if (scrollBar.style == R_SB_XTERM 2029 if (scrollBar.style == R_SB_XTERM
2032 || scrollbar_above_slider (ev.y) 2030 || scrollbar_above_slider (ev.y)
2033 || scrollbar_below_slider (ev.y)) 2031 || scrollbar_below_slider (ev.y))
2034 scr_move_to (scrollbar_position (ev.y) - csrO, scrollbar_size ()); 2032 scr_move_to (scrollbar_position (ev.y) - csrO, scrollbar_size ());
2035 2033
2036 scrollBar.setMotion (); 2034 scrollBar.state = STATE_MOTION;
2037 break; 2035 break;
2038 2036
2039 case Button1: 2037 case Button1:
2040 if (scrollBar.align == R_SB_ALIGN_CENTRE) 2038 if (scrollBar.align == R_SB_ALIGN_CENTRE)
2041 csrO = ev.y - scrollBar.top; 2039 csrO = ev.y - scrollBar.top;
2055 scr_page (DN, nrow - 1); 2053 scr_page (DN, nrow - 1);
2056# else 2054# else
2057 scr_page (DN, nrow / 4); 2055 scr_page (DN, nrow / 4);
2058# endif 2056# endif
2059 else 2057 else
2060 scrollBar.setMotion (); 2058 scrollBar.state = STATE_MOTION;
2061 } 2059 }
2062 else 2060 else
2063 { 2061 {
2064 scr_page ((ev.button == Button1 ? DN : UP), 2062 scr_page ((ev.button == Button1 ? DN : UP),
2065 (nrow 2063 (nrow
2082 2080
2083 csrO = 0; /* reset csr Offset */ 2081 csrO = 0; /* reset csr Offset */
2084 if (!bypass_keystate) 2082 if (!bypass_keystate)
2085 reportmode = !! (priv_modes & PrivMode_mouse_report); 2083 reportmode = !! (priv_modes & PrivMode_mouse_report);
2086 2084
2087 if (scrollbar_isUpDn ()) 2085 if (scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN)
2088 { 2086 {
2089 scrollBar.setIdle (); 2087 scrollBar.state = STATE_IDLE;
2090 scrollbar_show (0); 2088 scrollbar_show (0);
2091 } 2089 }
2092 2090
2093#ifdef SELECTION_SCROLLING 2091#ifdef SELECTION_SCROLLING
2094 sel_scroll_ev.stop(); 2092 sel_scroll_ev.stop();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines