Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Horizontal mouse wheel scrolling causes zooming in the 2D editor in 4.x (unlike 3.x) #77212

Closed
miv391 opened this issue May 18, 2023 · 7 comments · Fixed by #85473
Closed

Horizontal mouse wheel scrolling causes zooming in the 2D editor in 4.x (unlike 3.x) #77212

miv391 opened this issue May 18, 2023 · 7 comments · Fixed by #85473

Comments

@miv391
Copy link
Contributor

miv391 commented May 18, 2023

Godot version

v4.0.3.rc2.official [2ac4e3b]

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 [170ba33]

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

@AThousandShips

This comment was marked as outdated.

@miv391
Copy link
Contributor Author

miv391 commented May 18, 2023

I configured the middle button click to another of this mouse's (Logitech G502) button. The problem doesn't occur when I click that button quickly after zooming. So the problem seems to occur only when the same physical button is used for zooming (scroll wheel) and panning (middle button).

@AThousandShips
Copy link
Member

So then it's because you accidentally scroll when you click

@miv391
Copy link
Contributor Author

miv391 commented May 18, 2023

It is possible, but then it also is impossible to avoid. I'm normally using stepped mode where the wheel noticeably clicks when you scroll in either direction. I tried a few online mouse wheel testers and they did not detect any scrolling when I just clicked the mouse wheel. Clicking the mouse wheel doesn't cause any scrolling for example in vscode either. It may be possible that when the scroll wheel is touched the mouse sends some tiny values of scrolling and applications, Godot 3.6 including, just ignore those small values. If that is the case, I would recommend adding similar filtering of small scrolling values also to Godot 4.

@Calinou
Copy link
Member

Calinou commented May 18, 2023

If that is the case, I would recommend adding similar filtering of small scrolling values also to Godot 4.

Godot does not support high-precision scrolling on Windows. The issue is that you're accidentally triggering horizontal mouse wheel scrolling when clicking the middle mouse button, and the editor interprets this as vertical scrolling when no horizontal scrolling is available. I can confirm that pressing the left/right mouse wheel scroll buttons will cause the 2D editor to zoom in 4.0.2 but not in 3.5.2 on Linux (using a Logitech G903).

When testing this locally, remember that not all mice scroll wheels have horizontal buttons available. Modern superlight mice tend to lack support for horizontal scrolling entirely.

This erroneous behavior only occurs in the 2D editor viewport, not the 3D editor viewport, not the script editor, not other scrollable controls.

@Calinou Calinou changed the title Middle mouse button causes zooming in in 2D view Horizontal mouse wheel scrolling causes zooming in the 2D editor in 4.x (unlike 3.x) May 18, 2023
@miv391
Copy link
Contributor Author

miv391 commented May 18, 2023

The issue is that you're accidentally triggering horizontal mouse wheel scrolling when clicking the middle mouse button, and the editor interprets this as vertical scrolling when no horizontal scrolling is available. I can confirm that pressing the left/right mouse wheel scroll buttons will cause the 2D editor to zoom in 4.0.2 but not in 3.5.2 on Linux (using a Logitech G903).

I can confirm that too. When I disabled horizontal scrolling from mouse wheel, the problem didn't occur anymore.

@p10tr3k
Copy link
Contributor

p10tr3k commented Nov 28, 2023

I have encountered the same issue on MacOS. Very annoying, happens very often. I don't need scrolling with mouse wheel when Cmd button is pressed so adding just a setting to disable zooming in script editor with mouse would be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants