… | |
… | |
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-2005 Marc Lehmann <pcg@goof.com> |
30 | * Copyright (c) 2003-2006 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. |
… | |
… | |
867 | #endif |
867 | #endif |
868 | /* nil */ ; |
868 | /* nil */ ; |
869 | } |
869 | } |
870 | } |
870 | } |
871 | |
871 | |
|
|
872 | if (HOOK_INVOKE ((this, HOOK_KEY_PRESS, DT_XEVENT, &ev, DT_STRING_LEN, kbuf, len, DT_END))) |
|
|
873 | return; |
|
|
874 | |
872 | if (len <= 0) |
875 | if (len <= 0) |
873 | return; /* not mapped */ |
876 | return; /* not mapped */ |
874 | |
877 | |
875 | if (OPTION (Opt_scrollTtyKeypress)) |
878 | if (OPTION (Opt_scrollTtyKeypress)) |
876 | if (view_start) |
879 | if (view_start) |
… | |
… | |
1202 | |
1205 | |
1203 | #ifdef POINTER_BLANK |
1206 | #ifdef POINTER_BLANK |
1204 | void |
1207 | void |
1205 | rxvt_term::pointer_blank () |
1208 | rxvt_term::pointer_blank () |
1206 | { |
1209 | { |
1207 | if (! OPTION (Opt_pointerBlank)) |
1210 | if (!OPTION (Opt_pointerBlank)) |
1208 | return; |
1211 | return; |
1209 | |
1212 | |
1210 | XDefineCursor (display->display, vt, display->blank_cursor); |
1213 | XDefineCursor (display->display, vt, display->blank_cursor); |
1211 | XFlush (display->display); |
1214 | XFlush (display->display); |
1212 | |
1215 | |
… | |
… | |
1411 | # endif |
1414 | # endif |
1412 | else |
1415 | else |
1413 | iso14755buf = 0; |
1416 | iso14755buf = 0; |
1414 | } |
1417 | } |
1415 | #endif |
1418 | #endif |
|
|
1419 | |
|
|
1420 | if (ev.xany.window == vt && HOOK_INVOKE ((this, HOOK_KEY_RELEASE, DT_XEVENT, &ev, DT_END))) |
|
|
1421 | break; |
1416 | |
1422 | |
1417 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
1423 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
1418 | if (!(ev.xkey.state & ControlMask)) |
1424 | if (!(ev.xkey.state & ControlMask)) |
1419 | slip_wheel_ev.stop (); |
1425 | slip_wheel_ev.stop (); |
1420 | else if (ks == XK_Control_L || ks == XK_Control_R) |
1426 | else if (ks == XK_Control_L || ks == XK_Control_R) |
… | |
… | |
1635 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1641 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1636 | break; |
1642 | break; |
1637 | |
1643 | |
1638 | if (ev.xany.window == vt) |
1644 | if (ev.xany.window == vt) |
1639 | { |
1645 | { |
|
|
1646 | if (HOOK_INVOKE ((this, HOOK_MOTION_NOTIFY, DT_XEVENT, &ev, DT_END))) |
|
|
1647 | ; // nop |
1640 | if (ev.xbutton.state & (Button1Mask | Button3Mask)) |
1648 | else if (ev.xbutton.state & (Button1Mask | Button3Mask)) |
1641 | { |
1649 | { |
1642 | while (XCheckTypedWindowEvent (disp, vt, MotionNotify, &ev)) |
1650 | while (XCheckTypedWindowEvent (disp, vt, MotionNotify, &ev)) |
1643 | ; |
1651 | ; |
1644 | |
1652 | |
1645 | XQueryPointer (disp, vt, |
1653 | XQueryPointer (disp, vt, |
… | |
… | |
1894 | else |
1902 | else |
1895 | { |
1903 | { |
1896 | if (ev.button != MEvent.button) |
1904 | if (ev.button != MEvent.button) |
1897 | MEvent.clicks = 0; |
1905 | MEvent.clicks = 0; |
1898 | |
1906 | |
1899 | if (!HOOK_INVOKE ((this, HOOK_MOUSE_CLICK, DT_XEVENT, &ev, DT_END))) |
1907 | if (!HOOK_INVOKE ((this, HOOK_BUTTON_PRESS, DT_XEVENT, &ev, DT_END))) |
1900 | switch (ev.button) |
1908 | switch (ev.button) |
1901 | { |
1909 | { |
1902 | case Button1: |
1910 | case Button1: |
1903 | /* allow meta + click to select rectangular areas */ |
1911 | /* allow meta + click to select rectangular areas */ |
1904 | /* should be done in screen.C */ |
1912 | /* should be done in screen.C */ |
… | |
… | |
2155 | */ |
2163 | */ |
2156 | if (priv_modes & PrivMode_mouse_report |
2164 | if (priv_modes & PrivMode_mouse_report |
2157 | && bypass_keystate |
2165 | && bypass_keystate |
2158 | && ev.button == Button1 && MEvent.clicks <= 1) |
2166 | && ev.button == Button1 && MEvent.clicks <= 1) |
2159 | selection_extend (ev.x, ev.y, 0); |
2167 | selection_extend (ev.x, ev.y, 0); |
|
|
2168 | |
|
|
2169 | if (!HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END))) |
|
|
2170 | return; |
2160 | |
2171 | |
2161 | switch (ev.button) |
2172 | switch (ev.button) |
2162 | { |
2173 | { |
2163 | case Button1: |
2174 | case Button1: |
2164 | case Button3: |
2175 | case Button3: |
… | |
… | |
2718 | { |
2729 | { |
2719 | if (ch == NOCHAR) |
2730 | if (ch == NOCHAR) |
2720 | { |
2731 | { |
2721 | seq_begin = cmdbuf_ptr; |
2732 | seq_begin = cmdbuf_ptr; |
2722 | ch = next_char (); |
2733 | ch = next_char (); |
2723 | } |
|
|
2724 | |
2734 | |
2725 | if (ch == NOCHAR) // TODO: improve |
2735 | if (ch == NOCHAR) |
2726 | break; |
2736 | break; |
|
|
2737 | } |
2727 | |
2738 | |
2728 | if (!IS_CONTROL (ch) || ch == C0_LF || ch == C0_CR || ch == C0_HT) |
2739 | if (!IS_CONTROL (ch) || ch == C0_LF || ch == C0_CR || ch == C0_HT) |
2729 | { |
2740 | { |
2730 | if (!seen_input) |
2741 | if (!seen_input) |
2731 | { |
2742 | { |
… | |
… | |
4454 | const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT |
4465 | const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT |
4455 | |
4466 | |
4456 | void |
4467 | void |
4457 | rxvt_term::tt_write (const char *data, unsigned int len) |
4468 | rxvt_term::tt_write (const char *data, unsigned int len) |
4458 | { |
4469 | { |
|
|
4470 | if (pty.pty < 0) |
|
|
4471 | return; |
|
|
4472 | |
4459 | if (v_buflen == 0) |
4473 | if (v_buflen == 0) |
4460 | { |
4474 | { |
4461 | ssize_t written = write (pty.pty, data, min (len, MAX_PTY_WRITE)); |
4475 | ssize_t written = write (pty.pty, data, min (len, MAX_PTY_WRITE)); |
4462 | |
4476 | |
4463 | if ((unsigned int)written == len) |
4477 | if ((unsigned int)written == len) |