diff options
author | Tiago Cunha <tcunha@gmx.com> | 2010-06-06 00:23:44 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2010-06-06 00:23:44 +0000 |
commit | f62d3d22bb542e262ee961e5f3e2db33b963b4db (patch) | |
tree | d1f2fb87c3655247b1811ebcb9b1ab23dd6a594e /tty.c | |
parent | 67dc249d0ee890e6f1c1b9d6cec1f15d1a3e373c (diff) | |
download | rtmux-f62d3d22bb542e262ee961e5f3e2db33b963b4db.tar.gz rtmux-f62d3d22bb542e262ee961e5f3e2db33b963b4db.tar.bz2 rtmux-f62d3d22bb542e262ee961e5f3e2db33b963b4db.zip |
Sync OpenBSD patchset 710:
When the mode-mouse option is on, support dragging to make a selection
in copy mode.
Also support the scroll wheel, although xterm strangely does not ignore
it in application mouse mode, causing redraw artifacts when scrolling up
(other terminals appear to be better behaved).
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.189 2010-03-08 14:53:49 tcunha Exp $ */ +/* $Id: tty.c,v 1.190 2010-06-06 00:23:44 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -402,11 +402,18 @@ tty_update_mode(struct tty *tty, int mode) else tty_putcode(tty, TTYC_CIVIS); } - if (changed & MODE_MOUSE) { - if (mode & MODE_MOUSE) - tty_puts(tty, "\033[?1000h"); - else - tty_puts(tty, "\033[?1000l"); + if (changed & (MODE_MOUSE|MODE_MOUSEMOTION)) { + if (mode & MODE_MOUSE) { + if (mode & MODE_MOUSEMOTION) + tty_puts(tty, "\033[?1003h"); + else + tty_puts(tty, "\033[?1000h"); + } else { + if (mode & MODE_MOUSEMOTION) + tty_puts(tty, "\033[?1003l"); + else + tty_puts(tty, "\033[?1000l"); + } } if (changed & MODE_KKEYPAD) { if (mode & MODE_KKEYPAD) |