Closed sku0x20 closed 4 years ago
@siddhantkumar20 did you try this on a regular Ubuntu? I'm gonna fire up a live cd to reproduce this but I don't know how ZorinOS works.
@adam-arold hey I found the cause. The bug was occurring due to
(0..e.preciseWheelRotation.toInt()).forEach {
processMouseEvent(actionType, e)
}
in function "mouseWheelMoved" in file "MouseEventListener.kt" in zircon.jvm.swing. When e.preciseWheelRotation() is negative the forEach loop does not get executed therefore processMouseEvent(actionType, e) is unable to run, causing this issue. In my simple solution, I wrapped the e.preciseWheelRotation.toInt() with abs() function and everything seems to work fine.
(0..abs(e.preciseWheelRotation.toInt())).forEach {
processMouseEvent(actionType, e)
}
Thanks for responding so fast to this issue.
I'm gonna take a look into this. We have to make sure that your proposed fix doesn't break other platforms. Thanks for looking into this, your help is invaluable! 👍
@siddhantkumar20 can you open a PR with your changes? Then I can test them on other platforms and we can call it a day if it works.
@adam-arold I am a beginner and I am just learning things, I created the pull request #322 but I do not know if its the right way to do. Thanks for paying attention to this issue. I hope to become like you guys someday.
Don't worry what you did is exactly what was needed! I'm gonna try the examples and see whether it breaks something then we can merge your PR.
Describe the bug MouseEventType.MOUSE_WHEEL_ROTATED_UP is not getting triggered, whereas MouseEventType.MOUSE_WHEEL_ROTATED_DOWN works just fine. I tried both 'handleMouseEvents' and 'processMouseEvents' but nothing seems working.
To Reproduce Steps to reproduce the behavior:
Expected behavior MouseEventType.MOUSE_WHEEL_ROTATED_UP should be triggered
Screenshots NONE
Desktop (please complete the following information):
Smartphone (please complete the following information): NONE
Additional context I tried using LibgdxApplications in place of SwingApplications but still same result moreover now MOUSE_WHEEL_ROTATED_DOWN is also broken.