diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-10-26 14:35:42 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-10-26 14:35:42 +0000 |
commit | d210d99ccecfaa2ef23a65609dc8cbb26bcfe236 (patch) | |
tree | 8de6dd8ecc536d54cb9a8c4b2f0170dde99fbd0d /input-keys.c | |
parent | 2a609b332f6cdc2ef6f3ffb525a3c74ada738ec4 (diff) | |
download | rtmux-d210d99ccecfaa2ef23a65609dc8cbb26bcfe236.tar.gz rtmux-d210d99ccecfaa2ef23a65609dc8cbb26bcfe236.tar.bz2 rtmux-d210d99ccecfaa2ef23a65609dc8cbb26bcfe236.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 'input-keys.c')
-rw-r--r-- | input-keys.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/input-keys.c b/input-keys.c index bd1c6157..eee469e8 100644 --- a/input-keys.c +++ b/input-keys.c @@ -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; } |