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

Win32 Mousewheel: Scale input by WHEEL_DELTA #1874

Closed
zx64 opened this issue Jun 11, 2018 · 1 comment
Closed

Win32 Mousewheel: Scale input by WHEEL_DELTA #1874

zx64 opened this issue Jun 11, 2018 · 1 comment
Labels

Comments

@zx64
Copy link

zx64 commented Jun 11, 2018

I find the default mouse wheel implementation a bit too fiddly when using my laptop's trackpad because all wheel inputs are quantised to +1.0 or -1.0.

I've been using this implementation instead:

    case WM_MOUSEWHEEL:
    {
        io.MouseWheel += (float)GET_WHEEL_DELTA_WPARAM(wParam)/(float)WHEEL_DELTA;
        return 0;
    }
    case WM_MOUSEHWHEEL:
    {
        io.MouseWheelH += (float)GET_WHEEL_DELTA_WPARAM(wParam)/(float)WHEEL_DELTA;
        return 0;
    }

I've tested it on my laptop's (cheap Synaptics) trackpad and my MX518 (discrete scrolling only), so do not know how well this feels for mice with a horizontal wheel or wheels that can freely spin.

Thanks!

ocornut added a commit that referenced this issue Jun 11, 2018
…ner position messages (typically sent by track-pads). (#1874)
@ocornut
Copy link
Owner

ocornut commented Jun 11, 2018

This is correct, I'm surprised no one caught this one before.
I pushed the fix now, thank you!

Regular mouse wheel usually send a value of WHEEL_DELTA, which would be equivalent to the current code.

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

No branches or pull requests

2 participants