From bab6e572e4fef5c2b91bf8002ad977341b721488 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Oct 2002 16:50:42 +0000 Subject: [PATCH] Support scrolling with the mouse wheel (X servers apparently usually send a button 4 press for an upward wheel movement and a button 5 press for a downward one). Untested since my own trackball's button 4 does nothing obvious. Someone with a mouse wheel should give this a workout. git-svn-id: svn://svn.tartarus.org/sgt/putty@2069 cda61777-01e9-0310-a592-d414129be87e --- unix/pterm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/unix/pterm.c b/unix/pterm.c index c798ab99..9af22bbf 100644 --- a/unix/pterm.c +++ b/unix/pterm.c @@ -722,6 +722,15 @@ gint button_event(GtkWidget *widget, GdkEventButton *event, gpointer data) show_mouseptr(1); + if (event->button == 4 && event->type == GDK_BUTTON_PRESS) { + term_scroll(0, -5); + return TRUE; + } + if (event->button == 5 && event->type == GDK_BUTTON_PRESS) { + term_scroll(0, +5); + return TRUE; + } + shift = event->state & GDK_SHIFT_MASK; ctrl = event->state & GDK_CONTROL_MASK; alt = event->state & GDK_MOD1_MASK; -- 2.11.0