Skip to content

Mouse scroll wheel behaviour incorrect in OSR mode #26

Description

@magreenblatt

Original report by Anonymous.


Original issue 26 created by leichtenfels on 2014-01-13T09:26:16.000Z:

What steps will reproduce the problem?

  1. Start the demo with run.bat win64 Release
  2. Search for something on Google (page must be larger than viewport)
  3. Scroll using the mouse wheel

What is the expected output? What do you see instead?
Mouse wheel up scrolls down, wheel down scrolls up. Behaviour is inverted. Also, scroll delta is far too low. Scrolling using the wheel should behave as in native browsers.

What version of the product are you using? On what operating system?
Windows 7 x64
JDK 7u45 x64
JCEF trunk as of 2014-01-13

Please provide any additional information below.

Activity

  1. magreenblatt commented on Jan 13, 2014

    @magreenblatt
    CollaboratorAuthor

    Comment 1. originally posted by magreenblatt on 2014-01-13T15:25:37.000Z:

    Detecting the platform scroll direction in Java seems problematic: http://stackoverflow.com/questions/7074882/java-how-to-get-the-scrolling-method-in-os-x-lion. I'm open to suggestions on the best way to maintain consistency with both other Java controls and the platform settings.

  2. magreenblatt commented on Jun 17, 2014

    @magreenblatt
    CollaboratorAuthor

    Comment 2. originally posted by magreenblatt on 2014-06-17T18:16:58.000Z:

  3. magreenblatt commented on May 31, 2016

    @magreenblatt
    CollaboratorAuthor

    Issue #220 was marked as a duplicate of this issue.

  4. nebsar commented on Apr 9, 2025

    @nebsar

    Any progress on this issue?

  5. nebsar commented on Apr 9, 2025

    @nebsar

    This will solve the issue. The mouse wheel rotation should be reverted.

    canvas_.addMouseWheelListener(new MouseWheelListener() {
               @Override
               public void mouseWheelMoved(MouseWheelEvent e) {
                   canvas_.addMouseWheelListener(new MouseWheelListener() {
                       @Override
                       public void mouseWheelMoved(MouseWheelEvent e) {
                           MouseWheelEvent corrected = new MouseWheelEvent(
                                   e.getComponent(),
                                   e.getID(),
                                   e.getWhen(),
                                   e.getModifiersEx(),
                                   e.getX(),
                                   e.getY(),
                                   e.getClickCount(),
                                   e.isPopupTrigger(),
                                   e.getScrollType(),
                                   e.getScrollAmount(),
                                   -e.getWheelRotation()
                           );
    
                           sendMouseWheelEvent(corrected);
                       }
                   });
               }
           });
    
  6. 1053950438 commented on Jul 20, 2025

    @1053950438

    Hello, I'm also facing this problem now. Are there any solutions

  7. nebsar commented on Jul 20, 2025

    @nebsar

    Have you tried my solution?

  8. 1053950438 commented on Jul 21, 2025

    @1053950438

    [It has problem when call the method of createBrowser(url, isOffscreenRendered, isTransparent).
    if isOffscreenRendered is false than mouse wheel direction is correct, but jvm is shutdown after operation a few minute.
    If isOffscreenRendered is true than no problem, but mouse wheel direction is reversed.]I see. It can be solved by adjusting here

  9. added 2 commits that reference this issue on Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions