Work out mouse scroll wheel effect when the mouse is first detected and

store it in struct mouse_event, reduce the scroll size the 3 but allow
shift to reduce it to 1 and meta and ctrl to multiply by 3 if the
terminal supports them, also support wheel in choose mode. From Marcel
Partap.
This commit is contained in:
nicm
2014-04-03 08:20:29 +00:00
parent 8824dae6f7
commit acef311fe3
4 changed files with 32 additions and 11 deletions

View File

@ -721,7 +721,17 @@ window_choose_mouse(
struct window_choose_mode_data *data = wp->modedata;
struct screen *s = &data->screen;
struct window_choose_mode_item *item;
u_int idx;
u_int i, idx;
if (m->event == MOUSE_EVENT_WHEEL) {
for (i = 0; i < m->scroll; i++) {
if (m->wheel == MOUSE_WHEEL_UP)
window_choose_key(wp, sess, KEYC_UP);
else
window_choose_key(wp, sess, KEYC_DOWN);
}
return;
}
if (~m->event & MOUSE_EVENT_CLICK)
return;