### Godot version

v4.0.3.rc2.official [2ac4e3bb3]

### System information

Windows 10

### Issue description

I have a Logitech G502 mouse. Scroll wheel is also the middle button. Scroll wheel can be toggled to two different modes. Scrolling is either done in steps or in a continuous "free" mode.

Pressing middle mouse button sometimes causes involuntary zooming in, if the middle mouse button is pressed just after zooming by scroll wheel.

It doesn't matter, which scroll mode (stepped/free) of this mouse is used. 
The initial zooming direction by wheel doesn't matter, the involuntary zooming is always in.

This problem doesn't happen with v3.5.2.stable.official [170ba337a]


### Steps to reproduce

1. Open 2D view of any scene 
2. Use mouse scroll wheel to zoom either in or out 
3. Immediately after zoom in/out, press middle button (which is also the scroll wheel)
4. **Problem:** The view starts zooming in 
5. Stop pressing the middle button, zooming in stops 
6. Press middle button again 
7. **Problem:** The view starts zooming in again

### Minimal reproduction project

N/A
ERR_FAIL_COND(p_scroll_speed <= 0);
	scroll_speed = p_scroll_speed;
}
void ViewPanner::set_scroll_zoom_factor(float p_scroll_zoom_factor) {
	ERR_FAIL_COND(p_scroll_zoom_factor <= 1.0);
	scroll_zoom_factor = p_scroll_zoom_factor;
}
void ViewPanner::set_pan_axis(PanAxis p_pan_axis) {
	pan_axis = p_pan_axis;
}
void ViewPanner::setup(ControlScheme p_scheme, Ref<Shortcut> p_shortcut, bool p_simple_panning) {
	set_control_scheme(p_scheme);
	set_pan_shortcut(p_shortcut);
	set_simple_panning_enabled(p_simple_panning);
}
bool ViewPanner::is_panning() const {
	return is_dragging || pan_key_pressed;
}
void ViewPanner::set_force_drag(bool p_force) {
	force_drag = p_force;
}
ViewPanner::ViewPanner() {
	Array inputs;
	inputs.append(InputEventKey::create_reference(Key::SPACE));
	pan_view_shortcut.instantiate();
	pan_view_shortcut->set_events(inputs);
}