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 scrolling not working on macOS because of shift handling #4010

Closed
ptxmac opened this issue Apr 5, 2021 · 1 comment
Closed

Horizontal scrolling not working on macOS because of shift handling #4010

ptxmac opened this issue Apr 5, 2021 · 1 comment

Comments

@ptxmac
Copy link
Contributor

ptxmac commented Apr 5, 2021

Version/Branch of Dear ImGui:

Version: 1.83
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_opengl3.cpp + imgui_impl_glfwcpp
Compiler: clang
Operating System: macOS 11.2.3

My Issue/Question:

Imgui has a feature to allow the shift key to flip between horizontal/vertical scrolling: https://github.com/ocornut/imgui/blob/master/imgui.cpp#L3757

Unfortunately, this conflicts with macOS's built-in feature which does the same.

When holding down shift while scrolling on macOS, the system sends horizontal events, but imgui also detects the shift key, and only look at the vertical events - effectively disabling horizontal scrolling!

Standalone, minimal, complete and verifiable example:

Run any example (tested with sdl and glfw) that contains a horizontal scrollbar (e.g. demo menu / examples / log)

Suggested fix

Add an option to disable the shift scrolling override feature

@ocornut
Copy link
Owner

ocornut commented Apr 6, 2021

Pushed a fix for this (92b7b1f, slightly different from 2b0090c initially pushed).

I tried a magic mouse (with support for swiping on both axis) and Shift didn't affect either, so I presume it only affect something on mouse that only have a single axis.
I installed drivers to try a magic mouse on my Windows and Shift altered the vertical wheel into horizontal scroll, but didn't alter horizontal wheel into vertical scroll.

Should be fixed.

We'll be looking at #3795 next

@ocornut ocornut closed this as completed Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants