… | |
… | |
25 | * - extensive modifications |
25 | * - extensive modifications |
26 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
26 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
27 | * Copyright (c) 2001 Marius Gedminas |
27 | * Copyright (c) 2001 Marius Gedminas |
28 | * - Ctrl/Mod4+Tab works like Meta+Tab (options) |
28 | * - Ctrl/Mod4+Tab works like Meta+Tab (options) |
29 | * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> |
29 | * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> |
30 | * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> |
30 | * Copyright (c) 2003-2007 Marc Lehmann <pcg@goof.com> |
31 | * |
31 | * |
32 | * This program is free software; you can redistribute it and/or modify |
32 | * This program is free software; you can redistribute it and/or modify |
33 | * it under the terms of the GNU General Public License as published by |
33 | * it under the terms of the GNU General Public License as published by |
34 | * the Free Software Foundation; either version 2 of the License, or |
34 | * the Free Software Foundation; either version 2 of the License, or |
35 | * (at your option) any later version. |
35 | * (at your option) any later version. |
… | |
… | |
549 | if (keysym >= 0xFF00 && keysym <= 0xFFFF) |
549 | if (keysym >= 0xFF00 && keysym <= 0xFFFF) |
550 | { |
550 | { |
551 | { |
551 | { |
552 | bool kp = priv_modes & PrivMode_aplKP ? !shft : shft; |
552 | bool kp = priv_modes & PrivMode_aplKP ? !shft : shft; |
553 | newlen = 1; |
553 | newlen = 1; |
|
|
554 | #ifdef XK_KP_Home |
|
|
555 | static const KeySym keypadtrans[] = { |
|
|
556 | XK_KP_7, // XK_KP_Home |
|
|
557 | XK_KP_4, // XK_KP_Left |
|
|
558 | XK_KP_8, // XK_KP_Up |
|
|
559 | XK_KP_6, // XK_KP_Right |
|
|
560 | XK_KP_2, // XK_KP_Down |
|
|
561 | #ifndef UNSHIFTED_SCROLLKEYS |
|
|
562 | XK_KP_9, // XK_KP_Prior |
|
|
563 | XK_KP_3, // XK_KP_Next |
|
|
564 | #else |
|
|
565 | XK_Prior, |
|
|
566 | XK_Next, |
|
|
567 | #endif |
|
|
568 | XK_KP_1, // XK_KP_End |
|
|
569 | XK_KP_5, // XK_KP_Begin |
|
|
570 | }; |
|
|
571 | |
|
|
572 | if (IN_RANGE_INC (keysym, XK_KP_Home, XK_KP_Begin)) |
|
|
573 | { |
|
|
574 | unsigned int index = keysym - XK_KP_Home; |
|
|
575 | keysym = kp ? keypadtrans[index] : XK_Home + index; |
|
|
576 | } |
|
|
577 | else if (keysym == XK_KP_Insert) |
|
|
578 | keysym = kp ? XK_KP_0 : XK_Insert; |
|
|
579 | #ifndef NO_DELETE_KEY |
|
|
580 | else if (keysym == XK_KP_Delete) |
|
|
581 | keysym = kp ? XK_KP_Decimal : XK_Delete; |
|
|
582 | #endif |
|
|
583 | #endif |
554 | switch (keysym) |
584 | switch (keysym) |
555 | { |
585 | { |
556 | #ifndef NO_BACKSPACE_KEY |
586 | #ifndef NO_BACKSPACE_KEY |
557 | case XK_BackSpace: |
587 | case XK_BackSpace: |
558 | if (priv_modes & PrivMode_HaveBackSpace) |
588 | if (priv_modes & PrivMode_HaveBackSpace) |
… | |
… | |
564 | else |
594 | else |
565 | strcpy (kbuf, rs[Rs_backspace_key]); |
595 | strcpy (kbuf, rs[Rs_backspace_key]); |
566 | break; |
596 | break; |
567 | #endif |
597 | #endif |
568 | #ifndef NO_DELETE_KEY |
598 | #ifndef NO_DELETE_KEY |
569 | # ifdef XK_KP_Delete |
|
|
570 | case XK_KP_Delete: |
|
|
571 | /* allow shift to override */ |
|
|
572 | if (kp) |
|
|
573 | { |
|
|
574 | strcpy (kbuf, "\033On"); |
|
|
575 | break; |
|
|
576 | } |
|
|
577 | /* FALLTHROUGH */ |
|
|
578 | # endif |
|
|
579 | case XK_Delete: |
599 | case XK_Delete: |
580 | strcpy (kbuf, rs[Rs_delete_key]); |
600 | strcpy (kbuf, rs[Rs_delete_key]); |
581 | break; |
601 | break; |
582 | #endif |
602 | #endif |
583 | case XK_Tab: |
603 | case XK_Tab: |
… | |
… | |
595 | #endif |
615 | #endif |
596 | newlen = 0; |
616 | newlen = 0; |
597 | } |
617 | } |
598 | break; |
618 | break; |
599 | |
619 | |
600 | #ifdef XK_KP_Left |
|
|
601 | case XK_KP_Left: /* \033Ot or standard */ |
|
|
602 | case XK_KP_Up: /* \033Ox or standard */ |
|
|
603 | case XK_KP_Right: /* \033Ov or standard */ |
|
|
604 | case XK_KP_Down: /* \033Or or standard */ |
|
|
605 | if (kp) |
|
|
606 | { |
|
|
607 | strcpy (kbuf, "\033OZ"); |
|
|
608 | kbuf[2] = "txvr"[keysym - XK_KP_Left]; |
|
|
609 | break; |
|
|
610 | } |
|
|
611 | else |
|
|
612 | /* translate to std. cursor key */ |
|
|
613 | keysym = XK_Left + (keysym - XK_KP_Left); |
|
|
614 | /* FALLTHROUGH */ |
|
|
615 | #endif |
|
|
616 | case XK_Up: /* "\033[A" */ |
620 | case XK_Up: /* "\033[A" */ |
617 | case XK_Down: /* "\033[B" */ |
621 | case XK_Down: /* "\033[B" */ |
618 | case XK_Right: /* "\033[C" */ |
622 | case XK_Right: /* "\033[C" */ |
619 | case XK_Left: /* "\033[D" */ |
623 | case XK_Left: /* "\033[D" */ |
620 | strcpy (kbuf, "\033[Z"); |
624 | strcpy (kbuf, "\033[Z"); |
… | |
… | |
630 | else if (priv_modes & PrivMode_aplCUR) |
634 | else if (priv_modes & PrivMode_aplCUR) |
631 | kbuf[1] = 'O'; |
635 | kbuf[1] = 'O'; |
632 | break; |
636 | break; |
633 | |
637 | |
634 | #ifndef UNSHIFTED_SCROLLKEYS |
638 | #ifndef UNSHIFTED_SCROLLKEYS |
635 | # ifdef XK_KP_Prior |
|
|
636 | case XK_KP_Prior: |
|
|
637 | /* allow shift to override */ |
|
|
638 | if (kp) |
|
|
639 | { |
|
|
640 | strcpy (kbuf, "\033Oy"); |
|
|
641 | break; |
|
|
642 | } |
|
|
643 | /* FALLTHROUGH */ |
|
|
644 | # endif |
|
|
645 | case XK_Prior: |
639 | case XK_Prior: |
646 | strcpy (kbuf, "\033[5~"); |
640 | strcpy (kbuf, "\033[5~"); |
647 | break; |
641 | break; |
648 | # ifdef XK_KP_Next |
|
|
649 | case XK_KP_Next: |
|
|
650 | /* allow shift to override */ |
|
|
651 | if (kp) |
|
|
652 | { |
|
|
653 | strcpy (kbuf, "\033Os"); |
|
|
654 | break; |
|
|
655 | } |
|
|
656 | /* FALLTHROUGH */ |
|
|
657 | # endif |
|
|
658 | case XK_Next: |
642 | case XK_Next: |
659 | strcpy (kbuf, "\033[6~"); |
643 | strcpy (kbuf, "\033[6~"); |
660 | break; |
644 | break; |
661 | #endif |
645 | #endif |
662 | case XK_KP_Enter: |
646 | case XK_KP_Enter: |
… | |
… | |
681 | kbuf[0] = '\015'; |
665 | kbuf[0] = '\015'; |
682 | kbuf[1] = '\0'; |
666 | kbuf[1] = '\0'; |
683 | } |
667 | } |
684 | break; |
668 | break; |
685 | |
669 | |
686 | #ifdef XK_KP_Begin |
|
|
687 | case XK_KP_Begin: |
|
|
688 | strcpy (kbuf, "\033Ou"); |
|
|
689 | break; |
|
|
690 | |
|
|
691 | #endif |
|
|
692 | case XK_KP_F1: /* "\033OP" */ |
670 | case XK_KP_F1: /* "\033OP" */ |
693 | case XK_KP_F2: /* "\033OQ" */ |
671 | case XK_KP_F2: /* "\033OQ" */ |
694 | case XK_KP_F3: /* "\033OR" */ |
672 | case XK_KP_F3: /* "\033OR" */ |
695 | case XK_KP_F4: /* "\033OS" */ |
673 | case XK_KP_F4: /* "\033OS" */ |
696 | strcpy (kbuf, "\033OP"); |
674 | strcpy (kbuf, "\033OP"); |
… | |
… | |
728 | |
706 | |
729 | case XK_Find: |
707 | case XK_Find: |
730 | strcpy (kbuf, "\033[1~"); |
708 | strcpy (kbuf, "\033[1~"); |
731 | break; |
709 | break; |
732 | |
710 | |
733 | #ifdef XK_KP_Insert |
|
|
734 | case XK_KP_Insert: |
|
|
735 | /* allow shift to override */ |
|
|
736 | if (kp) |
|
|
737 | { |
|
|
738 | strcpy (kbuf, "\033Op"); |
|
|
739 | break; |
|
|
740 | } |
|
|
741 | /* FALLTHROUGH */ |
|
|
742 | #endif |
|
|
743 | case XK_Insert: |
711 | case XK_Insert: |
744 | strcpy (kbuf, "\033[2~"); |
712 | strcpy (kbuf, "\033[2~"); |
745 | break; |
713 | break; |
746 | #ifdef DXK_Remove /* support for DEC remove like key */ |
714 | #ifdef DXK_Remove /* support for DEC remove like key */ |
747 | case DXK_Remove: |
715 | case DXK_Remove: |
… | |
… | |
751 | strcpy (kbuf, "\033[3~"); |
719 | strcpy (kbuf, "\033[3~"); |
752 | break; |
720 | break; |
753 | case XK_Select: |
721 | case XK_Select: |
754 | strcpy (kbuf, "\033[4~"); |
722 | strcpy (kbuf, "\033[4~"); |
755 | break; |
723 | break; |
756 | #ifdef XK_KP_End |
|
|
757 | case XK_KP_End: |
|
|
758 | /* allow shift to override */ |
|
|
759 | if (kp) |
|
|
760 | { |
|
|
761 | strcpy (kbuf, "\033Oq"); |
|
|
762 | break; |
|
|
763 | } |
|
|
764 | /* FALLTHROUGH */ |
|
|
765 | #endif |
|
|
766 | case XK_End: |
724 | case XK_End: |
767 | strcpy (kbuf, KS_END); |
725 | strcpy (kbuf, KS_END); |
768 | break; |
726 | break; |
769 | #ifdef XK_KP_Home |
|
|
770 | case XK_KP_Home: |
|
|
771 | /* allow shift to override */ |
|
|
772 | if (kp) |
|
|
773 | { |
|
|
774 | strcpy (kbuf, "\033Ow"); |
|
|
775 | break; |
|
|
776 | } |
|
|
777 | /* FALLTHROUGH */ |
|
|
778 | #endif |
|
|
779 | case XK_Home: |
727 | case XK_Home: |
780 | strcpy (kbuf, KS_HOME); |
728 | strcpy (kbuf, KS_HOME); |
781 | break; |
729 | break; |
782 | |
730 | |
783 | #define FKEY(n, fkey) \ |
731 | #define FKEY(n, fkey) \ |
… | |
… | |
1100 | { |
1048 | { |
1101 | make_current (); |
1049 | make_current (); |
1102 | |
1050 | |
1103 | display->flush (); |
1051 | display->flush (); |
1104 | |
1052 | |
1105 | if (want_refresh && !flush_ev.active) |
1053 | if (want_refresh && !flush_ev.is_active ()) |
1106 | flush_ev.start (1. / 60.); // refresh at max. 60 hz normally |
1054 | flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally |
1107 | } |
1055 | } |
1108 | |
1056 | |
1109 | void |
1057 | void |
1110 | rxvt_term::flush_cb (ev::timer &w, int revents) |
1058 | rxvt_term::flush_cb (ev::timer &w, int revents) |
1111 | { |
1059 | { |
… | |
… | |
1131 | if (scr_refresh_rend (RS_Blink, RS_Blink)) |
1079 | if (scr_refresh_rend (RS_Blink, RS_Blink)) |
1132 | { |
1080 | { |
1133 | hidden_text = !hidden_text; |
1081 | hidden_text = !hidden_text; |
1134 | want_refresh = 1; |
1082 | want_refresh = 1; |
1135 | } |
1083 | } |
|
|
1084 | else |
|
|
1085 | w.stop (); |
1136 | } |
1086 | } |
1137 | #endif |
1087 | #endif |
1138 | |
1088 | |
1139 | #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING |
1089 | #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING |
1140 | void |
1090 | void |
… | |
… | |
1164 | |
1114 | |
1165 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
1115 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
1166 | void |
1116 | void |
1167 | rxvt_term::slip_wheel_cb (ev::timer &w, int revents) |
1117 | rxvt_term::slip_wheel_cb (ev::timer &w, int revents) |
1168 | { |
1118 | { |
1169 | if (mouse_slip_wheel_speed == 0 |
1119 | if (scr_page (mouse_slip_wheel_speed < 0 ? DN : UP, abs (mouse_slip_wheel_speed))) |
1170 | || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed) |
1120 | want_refresh = 1; |
1171 | : scr_page (UP, mouse_slip_wheel_speed)) |
1121 | |
|
|
1122 | if (view_start == top_row || view_start == 0 || mouse_slip_wheel_speed == 0) |
1172 | { |
1123 | { |
1173 | if (view_start == top_row || view_start == 0) |
|
|
1174 | mouse_slip_wheel_speed = 0; |
1124 | mouse_slip_wheel_speed = 0; |
1175 | |
|
|
1176 | want_refresh = 1; |
|
|
1177 | } |
|
|
1178 | else |
|
|
1179 | w.stop (); |
1125 | w.stop (); |
|
|
1126 | } |
1180 | } |
1127 | } |
1181 | #endif |
1128 | #endif |
1182 | |
1129 | |
1183 | #if LINUX_YIELD_HACK |
1130 | #if LINUX_YIELD_HACK |
1184 | static struct event_handler |
1131 | static struct event_handler |
… | |
… | |
1303 | int x, y; |
1250 | int x, y; |
1304 | int code = 32; |
1251 | int code = 32; |
1305 | |
1252 | |
1306 | x = Pixel2Col (ev.x); |
1253 | x = Pixel2Col (ev.x); |
1307 | y = Pixel2Row (ev.y); |
1254 | y = Pixel2Row (ev.y); |
1308 | if (ev.type == MotionNotify) { |
1255 | if (ev.type == MotionNotify) |
|
|
1256 | { |
1309 | if (x == mouse_row && y == mouse_col) |
1257 | if (x == mouse_row && y == mouse_col) |
1310 | return; |
1258 | return; |
1311 | mouse_row = x; |
1259 | mouse_row = x; |
1312 | mouse_col = y; |
1260 | mouse_col = y; |
1313 | code += 32; |
1261 | code += 32; |
1314 | } |
1262 | } |
1315 | |
1263 | |
1316 | if (MEvent.button == AnyButton) |
1264 | if (MEvent.button == AnyButton) |
1317 | button_number = 3; |
1265 | button_number = 3; |
1318 | else |
1266 | else |
1319 | { |
1267 | { |
… | |
… | |
1527 | break; |
1475 | break; |
1528 | |
1476 | |
1529 | case MapNotify: |
1477 | case MapNotify: |
1530 | mapped = 1; |
1478 | mapped = 1; |
1531 | #ifdef TEXT_BLINK |
1479 | #ifdef TEXT_BLINK |
1532 | text_blink_ev.start (TEXT_BLINK_INTERVAL); |
1480 | text_blink_ev.start (); |
1533 | #endif |
1481 | #endif |
1534 | HOOK_INVOKE ((this, HOOK_MAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1482 | HOOK_INVOKE ((this, HOOK_MAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1535 | break; |
1483 | break; |
1536 | |
1484 | |
1537 | case UnmapNotify: |
1485 | case UnmapNotify: |
… | |
… | |
1628 | int dist; |
1576 | int dist; |
1629 | |
1577 | |
1630 | /* don't clobber the current delay if we are |
1578 | /* don't clobber the current delay if we are |
1631 | * already in the middle of scrolling. |
1579 | * already in the middle of scrolling. |
1632 | */ |
1580 | */ |
1633 | if (!sel_scroll_ev.active) |
1581 | if (!sel_scroll_ev.is_active ()) |
1634 | sel_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); |
1582 | sel_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); |
1635 | |
1583 | |
1636 | /* save the event params so we can highlight |
1584 | /* save the event params so we can highlight |
1637 | * the selection in the pending-scroll loop |
1585 | * the selection in the pending-scroll loop |
1638 | */ |
1586 | */ |
… | |
… | |
1661 | else |
1609 | else |
1662 | { |
1610 | { |
1663 | /* we are within the text window, so we |
1611 | /* we are within the text window, so we |
1664 | * shouldn't be scrolling |
1612 | * shouldn't be scrolling |
1665 | */ |
1613 | */ |
1666 | if (sel_scroll_ev.active) |
|
|
1667 | sel_scroll_ev.stop(); |
1614 | sel_scroll_ev.stop(); |
1668 | } |
1615 | } |
1669 | #endif |
1616 | #endif |
1670 | #ifdef MOUSE_THRESHOLD |
1617 | #ifdef MOUSE_THRESHOLD |
1671 | } |
1618 | } |
1672 | #endif |
1619 | #endif |
… | |
… | |
1736 | XSetICFocus (Input_Context); |
1683 | XSetICFocus (Input_Context); |
1737 | } |
1684 | } |
1738 | #endif |
1685 | #endif |
1739 | #if CURSOR_BLINK |
1686 | #if CURSOR_BLINK |
1740 | if (option (Opt_cursorBlink)) |
1687 | if (option (Opt_cursorBlink)) |
1741 | cursor_blink_ev.start (CURSOR_BLINK_INTERVAL, CURSOR_BLINK_INTERVAL); |
1688 | cursor_blink_ev.again (); |
1742 | #endif |
1689 | #endif |
1743 | #if OFF_FOCUS_FADING |
1690 | #if OFF_FOCUS_FADING |
1744 | if (rs[Rs_fade]) |
1691 | if (rs[Rs_fade]) |
1745 | { |
1692 | { |
1746 | pix_colors = pix_colors_focused; |
1693 | pix_colors = pix_colors_focused; |
… | |
… | |
1901 | mouse_report (ev); |
1848 | mouse_report (ev); |
1902 | } |
1849 | } |
1903 | #else |
1850 | #else |
1904 | MEvent.button = ev.button; |
1851 | MEvent.button = ev.button; |
1905 | mouse_report (ev); |
1852 | mouse_report (ev); |
1906 | #endif /* MOUSE_REPORT_DOUBLECLICK */ |
1853 | #endif /* MOUSE_REPORT_DOUBLECLICK */ |
1907 | |
1854 | |
1908 | } |
1855 | } |
1909 | else |
1856 | else |
1910 | { |
1857 | { |
1911 | if (ev.button != MEvent.button) |
1858 | if (ev.button != MEvent.button) |
… | |
… | |
2005 | tt_printf ("\033[5~"); |
1952 | tt_printf ("\033[5~"); |
2006 | break; |
1953 | break; |
2007 | } |
1954 | } |
2008 | } |
1955 | } |
2009 | else |
1956 | else |
2010 | #endif /* NO_SCROLLBAR_REPORT */ |
1957 | #endif /* NO_SCROLLBAR_REPORT */ |
2011 | |
1958 | |
2012 | { |
1959 | { |
2013 | char upordown = 0; |
1960 | char upordown = 0; |
2014 | |
1961 | |
2015 | if (scrollBar.style == R_SB_NEXT) |
1962 | if (scrollBar.style == R_SB_NEXT) |
2016 | { |
1963 | { |
2017 | if (scrollbarnext_upButton (ev.y)) |
1964 | if (scrollbarnext_upButton (ev.y)) |
2018 | upordown = -1; /* up */ |
1965 | upordown = -1; /* up */ |
… | |
… | |
2024 | if (scrollbarrxvt_upButton (ev.y)) |
1971 | if (scrollbarrxvt_upButton (ev.y)) |
2025 | upordown = -1; /* up */ |
1972 | upordown = -1; /* up */ |
2026 | else if (scrollbarrxvt_dnButton (ev.y)) |
1973 | else if (scrollbarrxvt_dnButton (ev.y)) |
2027 | upordown = 1; /* down */ |
1974 | upordown = 1; /* down */ |
2028 | } |
1975 | } |
|
|
1976 | |
2029 | if (upordown) |
1977 | if (upordown) |
2030 | { |
1978 | { |
2031 | #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING |
1979 | #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING |
|
|
1980 | if (!cont_scroll_ev.is_active ()) |
2032 | cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); |
1981 | cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY); |
2033 | #endif |
1982 | #endif |
2034 | if (scr_page (upordown < 0 ? UP : DN, 1)) |
1983 | if (scr_page (upordown < 0 ? UP : DN, 1)) |
2035 | { |
1984 | { |
2036 | if (upordown < 0) |
1985 | if (upordown < 0) |
2037 | scrollBar.setUp (); |
1986 | scrollBar.setUp (); |
… | |
… | |
2117 | scrollBar.setIdle (); |
2066 | scrollBar.setIdle (); |
2118 | scrollbar_show (0); |
2067 | scrollbar_show (0); |
2119 | } |
2068 | } |
2120 | |
2069 | |
2121 | #ifdef SELECTION_SCROLLING |
2070 | #ifdef SELECTION_SCROLLING |
2122 | if (sel_scroll_ev.active) |
|
|
2123 | sel_scroll_ev.stop(); |
2071 | sel_scroll_ev.stop(); |
2124 | #endif |
2072 | #endif |
2125 | |
2073 | |
2126 | if (ev.window == vt) |
2074 | if (ev.window == vt) |
2127 | { |
2075 | { |
2128 | if (HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END))) |
2076 | if (HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END))) |
… | |
… | |
2152 | mouse_report (ev); |
2100 | mouse_report (ev); |
2153 | } |
2101 | } |
2154 | #else /* MOUSE_REPORT_DOUBLECLICK */ |
2102 | #else /* MOUSE_REPORT_DOUBLECLICK */ |
2155 | MEvent.button = AnyButton; |
2103 | MEvent.button = AnyButton; |
2156 | mouse_report (ev); |
2104 | mouse_report (ev); |
2157 | #endif /* MOUSE_REPORT_DOUBLECLICK */ |
2105 | #endif /* MOUSE_REPORT_DOUBLECLICK */ |
2158 | return; |
2106 | return; |
2159 | } |
2107 | } |
2160 | |
2108 | |
2161 | /* |
2109 | /* |
2162 | * dumb hack to compensate for the failure of click-and-drag |
2110 | * dumb hack to compensate for the failure of click-and-drag |
… | |
… | |
2200 | { |
2148 | { |
2201 | mouse_slip_wheel_speed += v ? -1 : 1; |
2149 | mouse_slip_wheel_speed += v ? -1 : 1; |
2202 | if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow; |
2150 | if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow; |
2203 | if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow; |
2151 | if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow; |
2204 | |
2152 | |
|
|
2153 | if (!slip_wheel_ev.is_active ()) |
2205 | slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); |
2154 | slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); |
2206 | } |
2155 | } |
2207 | else |
2156 | else |
2208 | { |
2157 | { |
2209 | # endif |
2158 | # endif |
2210 | scr_page (v, i); |
2159 | scr_page (v, i); |
… | |
… | |
2278 | |
2227 | |
2279 | if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1) |
2228 | if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1) |
2280 | { |
2229 | { |
2281 | refresh_count = 0; |
2230 | refresh_count = 0; |
2282 | |
2231 | |
2283 | if (!option (Opt_skipScroll) || ev::ev_time () > ev::now () + 1. / 60.) |
2232 | if (!option (Opt_skipScroll) || ev_time () > ev::now () + 1. / 60.) |
2284 | { |
2233 | { |
2285 | refreshnow = true; |
2234 | refreshnow = true; |
2286 | ch = NOCHAR; |
2235 | ch = NOCHAR; |
2287 | break; |
2236 | break; |
2288 | } |
2237 | } |
… | |
… | |
2499 | } |
2448 | } |
2500 | } |
2449 | } |
2501 | |
2450 | |
2502 | pclose_printer (fd); |
2451 | pclose_printer (fd); |
2503 | } |
2452 | } |
2504 | #endif /* PRINTPIPE */ |
2453 | #endif /* PRINTPIPE */ |
2505 | /*}}} */ |
2454 | /*}}} */ |
2506 | |
2455 | |
2507 | /* *INDENT-OFF* */ |
2456 | /* *INDENT-OFF* */ |
2508 | enum { |
2457 | enum { |
2509 | C1_40 = 0x40, |
2458 | C1_40 = 0x40, |
… | |
… | |
2802 | nargs = 0; |
2751 | nargs = 0; |
2803 | |
2752 | |
2804 | priv = 0; |
2753 | priv = 0; |
2805 | ch = cmd_getc (); |
2754 | ch = cmd_getc (); |
2806 | if (ch >= '<' && ch <= '?') |
2755 | if (ch >= '<' && ch <= '?') |
|
|
2756 | { |
2807 | { /* '<' '=' '>' '?' */ |
2757 | /* '<' '=' '>' '?' */ |
2808 | priv = ch; |
2758 | priv = ch; |
2809 | ch = cmd_getc (); |
2759 | ch = cmd_getc (); |
2810 | } |
2760 | } |
2811 | |
2761 | |
2812 | /* read any numerical arguments */ |
2762 | /* read any numerical arguments */ |
… | |
… | |
3632 | { 66, PrivMode_aplKP }, |
3582 | { 66, PrivMode_aplKP }, |
3633 | #ifndef NO_BACKSPACE_KEY |
3583 | #ifndef NO_BACKSPACE_KEY |
3634 | { 67, PrivMode_BackSpace }, |
3584 | { 67, PrivMode_BackSpace }, |
3635 | #endif |
3585 | #endif |
3636 | { 1000, PrivMode_MouseX11 }, |
3586 | { 1000, PrivMode_MouseX11 }, |
3637 | // 1001 Use Hilite Mouse Tracking. NYI, TODO |
|
|
3638 | { 1002, PrivMode_MouseBtnEvent }, |
3587 | { 1002, PrivMode_MouseBtnEvent }, |
3639 | { 1003, PrivMode_MouseAnyEvent }, |
3588 | { 1003, PrivMode_MouseAnyEvent }, |
3640 | { 1010, PrivMode_TtyOutputInh }, // rxvt extension |
3589 | { 1010, PrivMode_TtyOutputInh }, // rxvt extension |
3641 | { 1011, PrivMode_Keypress }, // rxvt extension |
3590 | { 1011, PrivMode_Keypress }, // rxvt extension |
3642 | // 1035 enable modifiers for alt, numlock NYI |
3591 | // 1035 enable modifiers for alt, numlock NYI |
… | |
… | |
3743 | /* case 67: - backspace key */ |
3692 | /* case 67: - backspace key */ |
3744 | case 1000: /* X11 mouse reporting */ |
3693 | case 1000: /* X11 mouse reporting */ |
3745 | if (state) /* orthogonal */ |
3694 | if (state) /* orthogonal */ |
3746 | priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); |
3695 | priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); |
3747 | break; |
3696 | break; |
3748 | #if 0 |
|
|
3749 | case 1001: |
|
|
3750 | break; /* X11 mouse highlighting */ |
|
|
3751 | #endif |
|
|
3752 | case 1002: |
3697 | case 1002: |
3753 | case 1003: |
3698 | case 1003: |
3754 | if (state) { |
3699 | if (state) |
|
|
3700 | { |
3755 | priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11); |
3701 | priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11); |
3756 | priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent; |
3702 | priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent; |
3757 | vt_emask_mouse = PointerMotionMask; |
3703 | vt_emask_mouse = PointerMotionMask; |
|
|
3704 | } |
3758 | } else |
3705 | else |
3759 | vt_emask_mouse = NoEventMask; |
3706 | vt_emask_mouse = NoEventMask; |
3760 | vt_select_input (); |
3707 | vt_select_input (); |
3761 | break; |
3708 | break; |
3762 | case 1010: /* scroll to bottom on TTY output inhibit */ |
3709 | case 1010: /* scroll to bottom on TTY output inhibit */ |
3763 | set_option (Opt_scrollTtyOutput, !state); |
3710 | set_option (Opt_scrollTtyOutput, !state); |
… | |
… | |
3943 | rxvt_term::process_graphics () |
3890 | rxvt_term::process_graphics () |
3944 | { |
3891 | { |
3945 | unicode_t ch, cmd = cmd_getc (); |
3892 | unicode_t ch, cmd = cmd_getc (); |
3946 | |
3893 | |
3947 | if (cmd == 'Q') |
3894 | if (cmd == 'Q') |
|
|
3895 | { |
3948 | { /* query graphics */ |
3896 | /* query graphics */ |
3949 | tt_printf ("\033G0\012"); /* no graphics */ |
3897 | tt_printf ("\033G0\012"); /* no graphics */ |
3950 | return; |
3898 | return; |
3951 | } |
3899 | } |
3952 | /* swallow other graphics sequences until terminating ':' */ |
3900 | /* swallow other graphics sequences until terminating ':' */ |
3953 | do |
3901 | do |