From: simon Date: Tue, 15 Oct 2002 16:50:42 +0000 (+0000) Subject: Support scrolling with the mouse wheel (X servers apparently usually X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/bab6e572e4fef5c2b91bf8002ad977341b721488 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 --- 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;