Support more mouse buttons when the terminal sends them, GitHub issue

3055.
This commit is contained in:
nicm
2022-02-16 18:55:05 +00:00
parent 5076beb009
commit 0027ee13a0
7 changed files with 728 additions and 44 deletions

6
menu.c
View File

@ -235,7 +235,7 @@ menu_key_cb(struct client *c, void *data, struct key_event *event)
if (KEYC_IS_MOUSE(event->key)) {
if (md->flags & MENU_NOMOUSE) {
if (MOUSE_BUTTONS(m->b) != 0)
if (MOUSE_BUTTONS(m->b) != MOUSE_BUTTON_1)
return (1);
return (0);
}
@ -248,7 +248,7 @@ menu_key_cb(struct client *c, void *data, struct key_event *event)
return (1);
} else {
if (!MOUSE_RELEASE(m->b) &&
MOUSE_WHEEL(m->b) == 0 &&
!MOUSE_WHEEL(m->b) &&
!MOUSE_DRAG(m->b))
return (1);
}
@ -262,7 +262,7 @@ menu_key_cb(struct client *c, void *data, struct key_event *event)
if (MOUSE_RELEASE(m->b))
goto chosen;
} else {
if (MOUSE_WHEEL(m->b) == 0 && !MOUSE_DRAG(m->b))
if (!MOUSE_WHEEL(m->b) && !MOUSE_DRAG(m->b))
goto chosen;
}
md->choice = m->y - (md->py + 1);