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

mousewheel direction reversed in glut (chrome) #2864

Closed
rsturgell opened this issue Oct 7, 2014 · 7 comments
Closed

mousewheel direction reversed in glut (chrome) #2864

rsturgell opened this issue Oct 7, 2014 · 7 comments
Assignees

Comments

@rsturgell
Copy link
Contributor

I think this is the result of

2ef851b

I'm now getting button=4 for "up" and button=3 for "down". Looks like that change reversed the sign in getMouseWheelDelta but kept the usage the same in library_glut onMouseWheel, so it makes sense that it reversed which button is reported.

@juj
Copy link
Collaborator

juj commented Oct 10, 2014

Apologies for the regression. However, there have been so many changes to this code path and the wheel direction has been reversed already three times, so in order to maintain stability, I don't want to change any code with respect to this, unless it is accompanied by a test case that can be compiled both natively and in the test suite that will expose the problem and prove the correct behavior after fixed. Would you be able to implement a minimal glut test app that shows the problem and add it to the test_interactive.py suite that one can verify the breakage and the fix?

@rsturgell
Copy link
Contributor Author

Ok, will do.

I THINK the fix is to just re-add the negation of wheelDelta (which you
removed in library_browser.js getMouseWheelDelta), because wheelDelta has
the opposite sense of positive from the other event properties. Do you
remember why you made that change?

Thanks,
Ryan

On Fri, Oct 10, 2014 at 7:27 AM, juj notifications@github.com wrote:

Apologies for the regression. However, there have been so many changes to
this code path and the wheel direction has been reversed already three
times, so in order to maintain stability, I don't want to change any code
with respect to this, unless it is accompanied by a test case that can be
compiled both natively and in the test suite that will expose the problem
and prove the correct behavior after fixed. Would you be able to implement
a minimal glut test app that shows the problem and add it to the
test_interactive.py suite that one can verify the breakage and the fix?


Reply to this email directly or view it on GitHub
#2864 (comment).

@juj
Copy link
Collaborator

juj commented Oct 11, 2014

The negation was added due to user bug report that mouse wheel was reversed in SDL by another even earlier commit. If the issue is GLUT only, then flipping the sign in the GLUT code will probably fix this, but let's add a test first so that the behavior is readily verifiable by anyone.

@rsturgell
Copy link
Contributor Author

Actually it looks like tests/glut_wheelevents already tests this, but the
test is just a bit buggy - it doesn't verify order, it simply checks that
both "up" and "down" events came. However, if you run the tests you can
tell if it passes based on whether both "mouse wheel ... event received"
message are printed.

If I change that test slightly to correctly report failure when the events
come in the wrong order, it passes in ff and fails in chrome.

This is NOT a glut issue, this is a mousewheel event issue in
library_browser.js. Note that in library_html5.js we do invert y for the
mousewheel event to match the wheel event.

I suspect glfw is also broken, though I couldn't get figure out how to
repro because, while tests/glfw.c reports mousewheel changes, they are
never triggered, I think because of the early out in
library_glfs.js:onMouseWheel where it doesn't trigger the event if
!GLFW.active.scrollFunc.

Ryan

On Sat, Oct 11, 2014 at 9:40 AM, juj notifications@github.com wrote:

The negation was added due to user bug report that mouse wheel was
reversed in SDL by another even earlier commit. If the issue is GLUT only,
then flipping the sign in the GLUT code will probably fix this, but let's
add a test first so that the behavior is readily verifiable by anyone.


Reply to this email directly or view it on GitHub
#2864 (comment).

@ghost
Copy link

ghost commented Dec 17, 2014

Direction still reversed for:
Chromium 39.0.2171.65
Ubuntu 14.04
emscripten 1.27.0
Direction correct for firefox.

@usagi
Copy link
Contributor

usagi commented Feb 7, 2015

It's not only glut problem, I have check the same behavior in glfw3(em-1.29).
// I was fix a like the problem in GLFW2 at #2304 . The problem is regression.

@stale
Copy link

stale bot commented Aug 31, 2019

This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Aug 31, 2019
@stale stale bot closed this as completed Sep 7, 2019
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

3 participants