aboutsummaryrefslogtreecommitdiff
path: root/input-keys.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2014-06-18 09:31:07 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2014-06-18 09:31:07 +0100
commit77f582ff137808cc3743ad545f63422cc8e71a71 (patch)
tree5737aa67c96dcd11d3474989889189732e374900 /input-keys.c
parentf5973b77763e3f8da8e8f6483464f6f4bc2f3981 (diff)
parent92af7f5901bd944e385e7fdbe8696b2c911ed776 (diff)
downloadrtmux-77f582ff137808cc3743ad545f63422cc8e71a71.tar.gz
rtmux-77f582ff137808cc3743ad545f63422cc8e71a71.tar.bz2
rtmux-77f582ff137808cc3743ad545f63422cc8e71a71.zip
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
Diffstat (limited to 'input-keys.c')
-rw-r--r--input-keys.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/input-keys.c b/input-keys.c
index 11126985..7531f22d 100644
--- a/input-keys.c
+++ b/input-keys.c
@@ -204,6 +204,21 @@ input_mouse(struct window_pane *wp, struct session *s, struct mouse_event *m)
char buf[40];
size_t len;
struct paste_buffer *pb;
+ u_int i;
+
+ /*
+ * If the alternate screen is active and hasn't enabled the mouse, send
+ * up and down key presses for the mouse wheel.
+ */
+ if (wp->saved_grid != NULL && !(wp->screen->mode & ALL_MOUSE_MODES)) {
+ for (i = 0; i < m->scroll; i++) {
+ if (m->wheel == MOUSE_WHEEL_UP)
+ input_key(wp, KEYC_UP);
+ else
+ input_key(wp, KEYC_DOWN);
+ }
+ return;
+ }
if (wp->screen->mode & ALL_MOUSE_MODES) {
/*