summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/input-keys.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-10-26 14:35:42 +0000
committernicm <nicm@openbsd.org>2012-10-26 14:35:42 +0000
commit6fb64d94ca693b518e097a5ab991262b9df2cf4f (patch)
tree5758b34ef8aaa619f8c354722013c090b6a53195 /usr.bin/tmux/input-keys.c
parentProperly clear trap frame in setregs() to avoid leaking registers across exec. (diff)
downloadwireguard-openbsd-6fb64d94ca693b518e097a5ab991262b9df2cf4f.tar.xz
wireguard-openbsd-6fb64d94ca693b518e097a5ab991262b9df2cf4f.zip
Make mouse event structure clearer by defining events (up, click, drag)
and simplifying how buttons and wheels are represented, from Ailin Nemui. Should be no functional changes.
Diffstat (limited to 'usr.bin/tmux/input-keys.c')
-rw-r--r--usr.bin/tmux/input-keys.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/tmux/input-keys.c b/usr.bin/tmux/input-keys.c
index 6b78bd67264..2ff1ecae3cc 100644
--- a/usr.bin/tmux/input-keys.c
+++ b/usr.bin/tmux/input-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input-keys.c,v 1.26 2012/07/10 11:53:01 nicm Exp $ */
+/* $OpenBSD: input-keys.c,v 1.27 2012/10/26 14:35:42 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -200,7 +200,7 @@ input_key(struct window_pane *wp, int key)
/* Translate mouse and output. */
void
-input_mouse(struct window_pane *wp, struct mouse_event *m)
+input_mouse(struct window_pane *wp, struct session *s, struct mouse_event *m)
{
char buf[10];
size_t len;
@@ -208,14 +208,14 @@ input_mouse(struct window_pane *wp, struct mouse_event *m)
if (wp->screen->mode & ALL_MOUSE_MODES) {
if (wp->screen->mode & MODE_MOUSE_UTF8) {
len = xsnprintf(buf, sizeof buf, "\033[M");
- len += utf8_split2(m->b + 32, &buf[len]);
+ len += utf8_split2(m->xb + 32, &buf[len]);
len += utf8_split2(m->x + 33, &buf[len]);
len += utf8_split2(m->y + 33, &buf[len]);
} else {
- if (m->b > 223 || m->x >= 222 || m->y > 222)
+ if (m->xb > 223 || m->x >= 222 || m->y > 222)
return;
len = xsnprintf(buf, sizeof buf, "\033[M");
- buf[len++] = m->b + 32;
+ buf[len++] = m->xb + 32;
buf[len++] = m->x + 33;
buf[len++] = m->y + 33;
}
@@ -223,12 +223,12 @@ input_mouse(struct window_pane *wp, struct mouse_event *m)
return;
}
- if ((m->b & 3) != 1 &&
+ if ((m->xb & 3) != 1 &&
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);
+ wp->mode->mouse(wp, s, m);
}
return;
}