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 touchpad scrolling on macOS #99

Open
turbo opened this issue Feb 2, 2024 · 4 comments
Open

Horizontal touchpad scrolling on macOS #99

turbo opened this issue Feb 2, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@turbo
Copy link

turbo commented Feb 2, 2024

Using macOS Sonoma (Apple Silicon), in none of the demos that have a horizontally scrolling container (e.g. the table demo in GuiHello) work with touchpad scrolling. I can scroll vertically, I can even scroll horizontally when the cursor hovers the bottom scrollbar, but if the cursor is in the view, only vertical scrolling functions.

Here's a demo showing what I mean. I try to do three things:

  1. scroll vertically (works)
  2. scroll horizontally with cursor inside the view (doesn't work)
  3. scroll horizontally by hovering the bottom scrollbar and moving my fingers vertically (works, but is very odd behavior)
Screen.Recording.2024-02-02.at.21.01.25.mov
@frang75 frang75 self-assigned this Feb 3, 2024
@frang75
Copy link
Owner

frang75 commented Feb 3, 2024

Hi @turbo ! Thanks for download and test NAppGUI.

Yes it's true. Horizontal mouse scrolling is disabled, not only for macOS, also for Windows/Linux.
When I was developing View support I was bothered by the horizontal micro-scrolls produced by the MagicMouse. It's easy to solve. I will upload it to GitHub shortly.

@frang75 frang75 added the enhancement New feature or request label Feb 3, 2024
@turbo
Copy link
Author

turbo commented Feb 3, 2024

Thanks! Yes, I think macOS is sufficiently different to warrant a change. The behaviour I'm used to from other macOS apps is that once you start to scroll in a particular direction, it will lock into that direction. But if you start with a diagonal gesture, it'll move more freely. That means there are usually no micro-scrolls happening once you start to scroll horizontally. That might be unique to macOS, but probably also applies to modern Windows laptops with Windows Precision Touchpad drivers.

@frang75
Copy link
Owner

frang75 commented Feb 3, 2024

Its a good tip. Set the scroll type based on first gesture. Perhaps I'll also add some user configuration for special kind of views.

enum mouse_motion_t
{
   ekMOUSE_FIXED_HORIZONTAL,
   ekMOUSE_FIXED_VERTICAL,
   ekMOUSE_FREE,
   ekMOUSE_BY_GESTURE (default)
};

view_mouse_config(View *view, mouse_motion_t motion);

@turbo
Copy link
Author

turbo commented Feb 3, 2024

That's a great idea. The option to have "free" is useful for some views (e.g. a map), and the default makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants