… | |
… | |
596 | newlen = 0; |
596 | newlen = 0; |
597 | } |
597 | } |
598 | break; |
598 | break; |
599 | |
599 | |
600 | #ifdef XK_KP_Left |
600 | #ifdef XK_KP_Left |
|
|
601 | case XK_KP_Left: /* \033Ot or standard */ |
601 | case XK_KP_Up: /* \033Ox or standard */ |
602 | case XK_KP_Up: /* \033Ox or standard */ |
|
|
603 | case XK_KP_Right: /* \033Ov or standard */ |
602 | case XK_KP_Down: /* \033Or or standard */ |
604 | case XK_KP_Down: /* \033Or or standard */ |
603 | case XK_KP_Right: /* \033Ov or standard */ |
|
|
604 | case XK_KP_Left: /* \033Ot or standard */ |
|
|
605 | if (kp) |
605 | if (kp) |
606 | { |
606 | { |
607 | strcpy (kbuf, "\033OZ"); |
607 | strcpy (kbuf, "\033OZ"); |
608 | kbuf[2] = "txvr"[keysym - XK_KP_Left]; |
608 | kbuf[2] = "txvr"[keysym - XK_KP_Left]; |
609 | break; |
609 | break; |
… | |
… | |
1034 | |
1034 | |
1035 | void |
1035 | void |
1036 | rxvt_term::flush () |
1036 | rxvt_term::flush () |
1037 | { |
1037 | { |
1038 | flush_ev.stop (); |
1038 | flush_ev.stop (); |
1039 | |
1039 | |
1040 | #ifdef HAVE_BG_PIXMAP |
1040 | #ifdef HAVE_BG_PIXMAP |
1041 | if (bgPixmap.check_clearChanged ()) |
1041 | if (bgPixmap.check_clearChanged ()) |
1042 | { |
1042 | { |
1043 | scr_clear (true); |
1043 | // scr_clear (true); This needs to be researched further! |
1044 | scr_touch (false); |
1044 | scr_touch (false); |
1045 | } |
1045 | } |
1046 | #endif |
1046 | #endif |
1047 | |
1047 | |
1048 | if (want_refresh) |
1048 | if (want_refresh) |
… | |
… | |
1301 | void |
1301 | void |
1302 | rxvt_term::mouse_report (XButtonEvent &ev) |
1302 | rxvt_term::mouse_report (XButtonEvent &ev) |
1303 | { |
1303 | { |
1304 | int button_number, key_state = 0; |
1304 | int button_number, key_state = 0; |
1305 | int x, y; |
1305 | int x, y; |
|
|
1306 | int code = 32; |
1306 | |
1307 | |
1307 | x = ev.x; |
1308 | x = Pixel2Col (ev.x); |
1308 | y = ev.y; |
1309 | y = Pixel2Row (ev.y); |
1309 | pixel_position (&x, &y); |
1310 | if (ev.type == MotionNotify) { |
|
|
1311 | if (x == mouse_row && y == mouse_col) |
|
|
1312 | return; |
|
|
1313 | mouse_row = x; |
|
|
1314 | mouse_col = y; |
|
|
1315 | code += 32; |
|
|
1316 | } |
1310 | |
1317 | |
1311 | if (MEvent.button == AnyButton) |
1318 | if (MEvent.button == AnyButton) |
1312 | button_number = 3; |
1319 | button_number = 3; |
1313 | else |
1320 | else |
1314 | { |
1321 | { |
… | |
… | |
1360 | x + 1, |
1367 | x + 1, |
1361 | y + 1); |
1368 | y + 1); |
1362 | #endif |
1369 | #endif |
1363 | |
1370 | |
1364 | tt_printf ("\033[M%c%c%c", |
1371 | tt_printf ("\033[M%c%c%c", |
1365 | (32 + button_number + key_state), |
1372 | (code + button_number + key_state), |
1366 | (32 + x + 1), |
1373 | (32 + x + 1), |
1367 | (32 + y + 1)); |
1374 | (32 + y + 1)); |
1368 | } |
1375 | } |
1369 | |
1376 | |
1370 | /*{{{ process an X event */ |
1377 | /*{{{ process an X event */ |
… | |
… | |
1577 | case MotionNotify: |
1584 | case MotionNotify: |
1578 | #ifdef POINTER_BLANK |
1585 | #ifdef POINTER_BLANK |
1579 | if (hidden_pointer) |
1586 | if (hidden_pointer) |
1580 | pointer_unblank (); |
1587 | pointer_unblank (); |
1581 | #endif |
1588 | #endif |
|
|
1589 | if ((priv_modes & PrivMode_MouseBtnEvent && ev.xbutton.state & (Button1Mask|Button2Mask|Button3Mask)) |
|
|
1590 | || priv_modes & PrivMode_MouseAnyEvent) |
|
|
1591 | mouse_report (ev.xbutton); |
1582 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1592 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1583 | break; |
1593 | break; |
1584 | |
1594 | |
1585 | if (ev.xany.window == vt) |
1595 | if (ev.xany.window == vt) |
1586 | { |
1596 | { |
… | |
… | |
2849 | { |
2859 | { |
2850 | // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt, |
2860 | // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt, |
2851 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
2861 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
2852 | // |
2862 | // |
2853 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
2863 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
2854 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify |
2864 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, 94 for urxvt <= 8.3, and 95 for later |
2855 | // that we do not support xterm mouse reporting (should be 95 when we do). |
2865 | // versions. |
2856 | // |
2866 | // |
2857 | tt_printf ("\033[>%d;94;0c", 'U'); |
2867 | tt_printf ("\033[>%d;95;0c", 'U'); |
2858 | } |
2868 | } |
2859 | break; |
2869 | break; |
2860 | case '?': |
2870 | case '?': |
2861 | if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') |
2871 | if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') |
2862 | process_terminal_mode (ch, priv, nargs, arg); |
2872 | process_terminal_mode (ch, priv, nargs, arg); |
… | |
… | |
3627 | #ifndef NO_BACKSPACE_KEY |
3637 | #ifndef NO_BACKSPACE_KEY |
3628 | { 67, PrivMode_BackSpace }, |
3638 | { 67, PrivMode_BackSpace }, |
3629 | #endif |
3639 | #endif |
3630 | { 1000, PrivMode_MouseX11 }, |
3640 | { 1000, PrivMode_MouseX11 }, |
3631 | // 1001 Use Hilite Mouse Tracking. NYI, TODO |
3641 | // 1001 Use Hilite Mouse Tracking. NYI, TODO |
3632 | // 1002 Use Cell Motion Mouse Tracking. NYI, TODO |
3642 | { 1002, PrivMode_MouseBtnEvent }, |
3633 | // 1003 Use All Motion Mouse Tracking. NYI, TODO |
3643 | { 1003, PrivMode_MouseAnyEvent }, |
3634 | { 1010, PrivMode_TtyOutputInh }, // rxvt extension |
3644 | { 1010, PrivMode_TtyOutputInh }, // rxvt extension |
3635 | { 1011, PrivMode_Keypress }, // rxvt extension |
3645 | { 1011, PrivMode_Keypress }, // rxvt extension |
3636 | // 1035 enable modifiers for alt, numlock NYI |
3646 | // 1035 enable modifiers for alt, numlock NYI |
3637 | // 1036 send ESC for meta keys NYI |
3647 | // 1036 send ESC for meta keys NYI |
3638 | // 1037 send DEL for keypad delete NYI |
3648 | // 1037 send DEL for keypad delete NYI |
… | |
… | |
3712 | scr_autowrap (state); |
3722 | scr_autowrap (state); |
3713 | break; |
3723 | break; |
3714 | /* case 8: - auto repeat, can't do on a per window basis */ |
3724 | /* case 8: - auto repeat, can't do on a per window basis */ |
3715 | case 9: /* X10 mouse reporting */ |
3725 | case 9: /* X10 mouse reporting */ |
3716 | if (state) /* orthogonal */ |
3726 | if (state) /* orthogonal */ |
3717 | priv_modes &= ~PrivMode_MouseX11; |
3727 | priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); |
3718 | break; |
3728 | break; |
3719 | #ifdef scrollBar_esc |
3729 | #ifdef scrollBar_esc |
3720 | case scrollBar_esc: |
3730 | case scrollBar_esc: |
3721 | if (scrollbar_mapping (state)) |
3731 | if (scrollbar_mapping (state)) |
3722 | { |
3732 | { |
… | |
… | |
3735 | break; |
3745 | break; |
3736 | /* case 66: - application key pad */ |
3746 | /* case 66: - application key pad */ |
3737 | /* case 67: - backspace key */ |
3747 | /* case 67: - backspace key */ |
3738 | case 1000: /* X11 mouse reporting */ |
3748 | case 1000: /* X11 mouse reporting */ |
3739 | if (state) /* orthogonal */ |
3749 | if (state) /* orthogonal */ |
3740 | priv_modes &= ~PrivMode_MouseX10; |
3750 | priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); |
3741 | break; |
3751 | break; |
3742 | #if 0 |
3752 | #if 0 |
3743 | case 1001: |
3753 | case 1001: |
3744 | break; /* X11 mouse highlighting */ |
3754 | break; /* X11 mouse highlighting */ |
3745 | #endif |
3755 | #endif |
|
|
3756 | case 1002: |
|
|
3757 | case 1003: |
|
|
3758 | if (state) { |
|
|
3759 | priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11); |
|
|
3760 | priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent; |
|
|
3761 | vt_emask_mouse = PointerMotionMask; |
|
|
3762 | } else |
|
|
3763 | vt_emask_mouse = NoEventMask; |
|
|
3764 | vt_select_input (); |
|
|
3765 | break; |
3746 | case 1010: /* scroll to bottom on TTY output inhibit */ |
3766 | case 1010: /* scroll to bottom on TTY output inhibit */ |
3747 | set_option (Opt_scrollTtyOutput, !state); |
3767 | set_option (Opt_scrollTtyOutput, !state); |
3748 | break; |
3768 | break; |
3749 | case 1011: /* scroll to bottom on key press */ |
3769 | case 1011: /* scroll to bottom on key press */ |
3750 | set_option (Opt_scrollTtyKeypress, state); |
3770 | set_option (Opt_scrollTtyKeypress, state); |