From ff2f4824c1a24e158d218f44db11cc682b4881c8 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Wed, 29 Jul 2026 15:23:54 +0200 Subject: [PATCH] allow control-mousewheel and shift-mousewheel horiz/vert scrolling in schematic window even if graph_use_ctrl_key is set. --- src/callback.c | 65 ++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/src/callback.c b/src/callback.c index 64cae79e..bea939ff 100644 --- a/src/callback.c +++ b/src/callback.c @@ -2190,7 +2190,6 @@ static void context_menu_action(double mx, double my) /* Mouse wheel events */ static int handle_mouse_wheel(int event, int mx, int my, KeySym key, int button, int aux, int state) { - int graph_use_ctrl_key = tclgetboolvar("graph_use_ctrl_key"); if(button==Button5 && state == 0 ) { if(waves_selected(event, key, state, button)) { waves_callback(event, mx, my, key, button, aux, state); @@ -2209,40 +2208,38 @@ static int handle_mouse_wheel(int event, int mx, int my, KeySym key, int button, view_zoom(CADZOOMSTEP); return 0; } - if(!graph_use_ctrl_key) { - if(button==Button4 && (state & ShiftMask) && !(state & Button2Mask)) { - if(waves_selected(event, key, state, button)) { - waves_callback(event, mx, my, key, button, aux, state); - return 1; - } - /* pan to the right; move schematic to left */ - xctx->xorigin+=-CADMOVESTEP*xctx->zoom/2.; - draw(); - redraw_w_a_l_r_p_z_rubbers(1); - } - else if(button==Button5 && (state & ShiftMask) && !(state & Button2Mask)) { - if(waves_selected(event, key, state, button)) { - waves_callback(event, mx, my, key, button, aux, state); - return 1; - } + if(button==Button4 && (state & ShiftMask) && !(state & Button2Mask)) { + if(waves_selected(event, key, state, button)) { + waves_callback(event, mx, my, key, button, aux, state); + return 1; + } + /* pan to the right; move schematic to left */ + xctx->xorigin+=-CADMOVESTEP*xctx->zoom/2.; + draw(); + redraw_w_a_l_r_p_z_rubbers(1); + } + else if(button==Button5 && (state & ShiftMask) && !(state & Button2Mask)) { + if(waves_selected(event, key, state, button)) { + waves_callback(event, mx, my, key, button, aux, state); + return 1; + } - /* pan to the left; move schematic to right */ - xctx->xorigin-=-CADMOVESTEP*xctx->zoom/2.; - draw(); - redraw_w_a_l_r_p_z_rubbers(1); - } - else if(button==Button4 && (state & ControlMask) && !(state & Button2Mask)) { - /* pan down; move schematic up */ - xctx->yorigin+=-CADMOVESTEP*xctx->zoom/2.; - draw(); - redraw_w_a_l_r_p_z_rubbers(1); - } - else if(button==Button5 && (state & ControlMask) && !(state & Button2Mask)) { - /* pan up; move schematic down */ - xctx->yorigin-=-CADMOVESTEP*xctx->zoom/2.; - draw(); - redraw_w_a_l_r_p_z_rubbers(1); - } + /* pan to the left; move schematic to right */ + xctx->xorigin-=-CADMOVESTEP*xctx->zoom/2.; + draw(); + redraw_w_a_l_r_p_z_rubbers(1); + } + else if(button==Button4 && (state & ControlMask) && !(state & Button2Mask)) { + /* pan down; move schematic up */ + xctx->yorigin+=-CADMOVESTEP*xctx->zoom/2.; + draw(); + redraw_w_a_l_r_p_z_rubbers(1); + } + else if(button==Button5 && (state & ControlMask) && !(state & Button2Mask)) { + /* pan up; move schematic down */ + xctx->yorigin-=-CADMOVESTEP*xctx->zoom/2.; + draw(); + redraw_w_a_l_r_p_z_rubbers(1); } return 0; }