diff options
| author | Quentin Carbonneaux | 2014-08-12 13:49:22 -0400 |
|---|---|---|
| committer | Quentin Carbonneaux | 2014-08-12 13:49:22 -0400 |
| commit | fb1f7bb4f8e73b03315eea276d37fc7b09bd3f3e (patch) | |
| tree | 41386894ef28ccffbfbc8b2f2cec7f56a95b3ff2 | |
| parent | f18cd5260641ba7bb9157e4030aa2af68c9f966e (diff) | |
add mouse scrolling support
| -rw-r--r-- | main.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -49,8 +49,15 @@ gev(int fd, int flag, void *unused) scrolling = 0; break; case GMouseClick: - if (e.mouse.button == GBLeft) + if (e.mouse.button == GBLeft) { win_set_cursor(curwin, e.mouse.x, e.mouse.y); + } else if (e.mouse.button == GBWheelUp) { + scrolling = 1; + win_scroll(curwin, -4); + } else if (e.mouse.button == GBWheelDown) { + scrolling = 1; + win_scroll(curwin, +4); + } break; case GMouseSelect: win_set_cursor(curwin, e.mouse.x, e.mouse.y); |
