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).
This commit is contained in:
Tiago Cunha
2010-06-06 00:23:44 +00:00
parent 67dc249d0e
commit f62d3d22bb
5 changed files with 73 additions and 22 deletions

View File

@ -1,4 +1,4 @@
/* $Id: tty-keys.c,v 1.56 2010-03-15 20:44:51 nicm Exp $ */
/* $Id: tty-keys.c,v 1.57 2010-06-06 00:23:44 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -612,7 +612,8 @@ tty_keys_mouse(const char *buf, size_t len, size_t *size, struct mouse_event *m)
return (1);
*size = 6;
log_debug("mouse input is: %.6s", buf);
log_debug(
"mouse input: %.6s (%hhu,%hhu/%hhu)", buf, buf[4], buf[5], buf[3]);
m->b = buf[3];
m->x = buf[4];