mirror of
https://github.com/tmate-io/tmate.git
synced 2026-07-23 19:17:42 +00:00
Simplify mouse input function.
This commit is contained in:
parent
c829bdf537
commit
18d3498fb2
1 changed files with 6 additions and 5 deletions
11
input-keys.c
11
input-keys.c
|
|
@ -204,7 +204,6 @@ input_mouse(struct window_pane *wp, struct mouse_event *m)
|
|||
{
|
||||
char buf[10];
|
||||
size_t len;
|
||||
int value;
|
||||
|
||||
if (wp->screen->mode & ALL_MOUSE_MODES) {
|
||||
if (wp->screen->mode & MODE_MOUSE_UTF8) {
|
||||
|
|
@ -221,13 +220,15 @@ input_mouse(struct window_pane *wp, struct mouse_event *m)
|
|||
buf[len++] = m->y + 33;
|
||||
}
|
||||
bufferevent_write(wp->event, buf, len);
|
||||
} else if ((m->b & MOUSE_BUTTON) != MOUSE_2) {
|
||||
value = options_get_number(&wp->window->options, "mode-mouse");
|
||||
if (value == 1 &&
|
||||
window_pane_set_mode(wp, &window_copy_mode) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (options_get_number(&wp->window->options, "mode-mouse") == 1) {
|
||||
if (window_pane_set_mode(wp, &window_copy_mode) == 0) {
|
||||
window_copy_init_from_pane(wp);
|
||||
if (wp->mode->mouse != NULL)
|
||||
wp->mode->mouse(wp, NULL, m);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue