… | |
… | |
1295 | mouse_col = y; |
1295 | mouse_col = y; |
1296 | state += 32; |
1296 | state += 32; |
1297 | } |
1297 | } |
1298 | |
1298 | |
1299 | button_number = MEvent.button - Button1; |
1299 | button_number = MEvent.button - Button1; |
1300 | /* add 0x3D for wheel events, like xterm does */ |
1300 | if (button_number > 10) |
|
|
1301 | return; |
|
|
1302 | else if (button_number >= 7) |
|
|
1303 | button_number += 128 - 7; |
1301 | if (button_number >= 3) |
1304 | else if (button_number >= 3) |
1302 | button_number += 64 - 3; |
1305 | button_number += 64 - 3; |
1303 | |
1306 | |
1304 | if (priv_modes & PrivMode_MouseX10) |
1307 | if (priv_modes & PrivMode_MouseX10) |
1305 | { |
1308 | { |
1306 | /* |
1309 | /* |
… | |
… | |
1356 | tt_printf ("\033[%d;%d;%dM", |
1359 | tt_printf ("\033[%d;%d;%dM", |
1357 | code, |
1360 | code, |
1358 | x, |
1361 | x, |
1359 | y); |
1362 | y); |
1360 | else if (priv_modes & PrivMode_ExtMouseUTF8) |
1363 | else if (priv_modes & PrivMode_ExtMouseUTF8) |
|
|
1364 | if (code < 128) |
1361 | tt_printf ("\033[M%c%lc%lc", |
1365 | tt_printf ("\033[M%c%lc%lc", |
1362 | code, |
1366 | code, |
1363 | wint_t (32 + x), |
1367 | wint_t (32 + x), |
1364 | wint_t (32 + y)); |
1368 | wint_t (32 + y)); |
|
|
1369 | else |
|
|
1370 | tt_printf ("\033[M%c%c%lc%lc", |
|
|
1371 | 0xc0 + (code >> 6), |
|
|
1372 | 0x80 + (code & 0x3f), |
|
|
1373 | wint_t (32 + x), |
|
|
1374 | wint_t (32 + y)); |
1365 | else |
1375 | else |
1366 | #endif |
1376 | #endif |
1367 | tt_printf ("\033[M%c%c%c", |
1377 | tt_printf ("\033[M%c%c%c", |
1368 | code, |
1378 | code, |
1369 | 32 + x, |
1379 | 32 + x, |
… | |
… | |
2141 | |
2151 | |
2142 | if (reportmode) |
2152 | if (reportmode) |
2143 | { |
2153 | { |
2144 | /* mouse report from vt window */ |
2154 | /* mouse report from vt window */ |
2145 | /* don't report release of wheel "buttons" */ |
2155 | /* don't report release of wheel "buttons" */ |
2146 | if (ev.button >= 4) |
2156 | if (ev.button >= 4 && ev.button <= 7) |
2147 | return; |
2157 | return; |
2148 | #ifdef MOUSE_REPORT_DOUBLECLICK |
2158 | #ifdef MOUSE_REPORT_DOUBLECLICK |
2149 | /* only report the release of 'slow' single clicks */ |
2159 | /* only report the release of 'slow' single clicks */ |
2150 | if (MEvent.button != AnyButton |
2160 | if (MEvent.button != AnyButton |
2151 | && (ev.button != MEvent.button |
2161 | && (ev.button != MEvent.button |