diff -ur putty-0.61.orig/terminal.c putty-0.61/terminal.c
old
|
new
|
|
1224 | 1224 | term->alt_which = 0; |
1225 | 1225 | term_print_finish(term); |
1226 | 1226 | term->xterm_mouse = 0; |
| 1227 | term->xterm_extended_mouse = 0; |
| 1228 | term->urxvt_extended_mouse = 0; |
1227 | 1229 | set_raw_mouse_mode(term->frontend, FALSE); |
1228 | 1230 | { |
1229 | 1231 | int i; |
… |
… |
|
2398 | 2400 | term->xterm_mouse = state ? 2 : 0; |
2399 | 2401 | set_raw_mouse_mode(term->frontend, state); |
2400 | 2402 | break; |
| 2403 | case 1005: /* xterm extended mouse */ |
| 2404 | term->xterm_extended_mouse = state ? 1 : 0; |
| 2405 | break; |
| 2406 | case 1015: /* urxvt extended mouse */ |
| 2407 | term->urxvt_extended_mouse = state ? 1 : 0; |
| 2408 | break; |
2401 | 2409 | case 1047: /* alternate screen */ |
2402 | 2410 | compatibility(OTHER); |
2403 | 2411 | deselect(term); |
… |
… |
|
5699 | 5707 | if (raw_mouse && |
5700 | 5708 | (term->selstate != ABOUT_TO) && (term->selstate != DRAGGING)) { |
5701 | 5709 | int encstate = 0, r, c; |
5702 | | char abuf[16]; |
| 5710 | char abuf[32]; |
| 5711 | int len = 0; |
5703 | 5712 | |
5704 | 5713 | if (term->ldisc) { |
5705 | 5714 | |
… |
… |
|
5742 | 5751 | encstate += 0x04; |
5743 | 5752 | if (ctrl) |
5744 | 5753 | encstate += 0x10; |
5745 | | r = y + 33; |
5746 | | c = x + 33; |
| 5754 | r = y + 1; |
| 5755 | c = x + 1; |
5747 | 5756 | |
5748 | | sprintf(abuf, "\033[M%c%c%c", encstate, c, r); |
5749 | | ldisc_send(term->ldisc, abuf, 6, 0); |
| 5757 | if (term->urxvt_extended_mouse) { |
| 5758 | len = sprintf(abuf, "\033[%d;%d;%dM", encstate, c, r); |
| 5759 | } else if (term->xterm_extended_mouse) { |
| 5760 | if (c <= 2015 && r <= 2015) { |
| 5761 | wchar_t input[2]; |
| 5762 | wchar_t *inputp = input; |
| 5763 | int inputlen = 2; |
| 5764 | input[0] = c + 32; |
| 5765 | input[1] = r + 32; |
| 5766 | |
| 5767 | len = sprintf(abuf, "\033[M%c", encstate); |
| 5768 | len += charset_from_unicode(&inputp, &inputlen, |
| 5769 | abuf + len, 4, |
| 5770 | CS_UTF8, NULL, NULL, 0); |
| 5771 | } |
| 5772 | } else if (c <= 223 && r <= 223) { |
| 5773 | len = sprintf(abuf, "\033[M%c%c%c", encstate, c + 32, r + 32); |
| 5774 | } |
| 5775 | ldisc_send(term->ldisc, abuf, len, 0); |
5750 | 5776 | } |
5751 | 5777 | return; |
5752 | 5778 | } |
diff -ur putty-0.61.orig/terminal.h putty-0.61/terminal.h
old
|
new
|
|
152 | 152 | int big_cursor; |
153 | 153 | |
154 | 154 | int xterm_mouse; /* send mouse messages to host */ |
| 155 | int xterm_extended_mouse; |
| 156 | int urxvt_extended_mouse; |
155 | 157 | int mouse_is_down; /* used while tracking mouse buttons */ |
156 | 158 | |
157 | 159 | int cset_attr[2]; |