diff options
author | Thomas Adam <thomas@xteddy.org> | 2014-05-13 21:58:48 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2014-05-13 21:58:48 +0100 |
commit | bae95844d75b257c61cd0ef57b1d826bdca09032 (patch) | |
tree | e2547df0ea03a6f686ac0cf7500bed3d00994ad2 /input-keys.c | |
parent | ea5a223a2e8901fa9afa991d147751d8a6789443 (diff) | |
parent | b3e8d440ed0477e88232c3ba1779c67eafce3a48 (diff) | |
download | rtmux-bae95844d75b257c61cd0ef57b1d826bdca09032.tar.gz rtmux-bae95844d75b257c61cd0ef57b1d826bdca09032.tar.bz2 rtmux-bae95844d75b257c61cd0ef57b1d826bdca09032.zip |
Merge branch 'obsd-master'
Conflicts:
format.c
window.c
Diffstat (limited to 'input-keys.c')
-rw-r--r-- | input-keys.c | 15 |
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) { /* |