From 20fcfe436fad9dc966153c3bef977cee3050e7c3 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Wed, 29 Feb 2012 21:33:14 -0800 Subject: [PATCH] Change mouse bindings... MOUSEWHEEL and SHIFT+MOUSEWHEEL scroll verically and horizontally. Alt+Mousewheel adjusts note velocity. And Ctrl+Alt+LeftButton invokes randomize row. --- src/gui/input.C | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/gui/input.C b/src/gui/input.C index 3e83e2c..307348c 100644 --- a/src/gui/input.C +++ b/src/gui/input.C @@ -259,7 +259,7 @@ canvas_input_callback ( O_Canvas *widget, Canvas *c, int m ) break; } - if ( IS_PATTERN && Fl::event_state() & FL_CTRL ) + if ( IS_PATTERN && Fl::event_state() & ( FL_ALT | FL_CTRL ) ) c->randomize_row( y ); else c->set( x, y ); @@ -298,8 +298,31 @@ canvas_input_callback ( O_Canvas *widget, Canvas *c, int m ) { if ( Fl::event_state() & FL_CTRL ) c->adj_length( x, y, (0 - Fl::event_dy()) ); - else + else if ( Fl::event_state() & FL_ALT ) c->adj_color( x, y, (0 - Fl::event_dy()) * 5 ); + else if ( Fl::event_state() & FL_SHIFT ) + { + if ( Fl::event_dy() > 0 ) + { + c->pan( RIGHT, Fl::event_dy() * 5 ); + } + else + { + c->pan( LEFT, 0 - Fl::event_dy() * 5 ); + } + } + else + { + if ( Fl::event_dy() > 0 ) + { + c->pan( DOWN, Fl::event_dy() * 1 ); + } + else + { + c->pan( UP, (0 - Fl::event_dy()) * 1 ); + } + } + break; } default: