[piccolo2d-dev] Re: Issue 207 in piccolo2d: Horizontal scrolling causes an exception
Comment #7 on issue 207 by nls...@gmail.com: Horizontal scrolling causes an exception http://code.google.com/p/piccolo2d/issues/detail?id=207 Actually it is not even possible to distinguish right from left scrolling with the events fired by Sun Java 6. I have also tested this with OpenJDK Java 6/7 with the following results for right tilt followed by left tilt: Sun Java 6: java.awt.event.MouseEvent[MOUSE_PRESSED,(385,400),absolute(549,601),button=0,clickCount=1] java.awt.event.MouseEvent[MOUSE_RELEASED,(385,400),absolute(549,601),button=0,clickCount=1] java.awt.event.MouseEvent[MOUSE_PRESSED,(387,400),absolute(551,601),button=0,clickCount=1] java.awt.event.MouseEvent[MOUSE_RELEASED,(387,400),absolute(551,601),button=0,clickCount=1] OpenJDK Java 6: java.awt.event.MouseEvent[MOUSE_PRESSED,(245,274),absolute(350,400),button=0,clickCount=1] java.awt.event.MouseEvent[MOUSE_RELEASED,(245,274),absolute(350,400),button=0,clickCount=1] java.awt.event.MouseEvent[MOUSE_PRESSED,(311,274),absolute(416,400),button=0,clickCount=1] java.awt.event.MouseEvent[MOUSE_RELEASED,(311,274),absolute(416,400),button=0,clickCount=1] OpenJDK Java 7: java.awt.event.MouseEvent[MOUSE_PRESSED,(261,202),absolute(366,328),button=5,extModifiers=Button5,clickCount=1] java.awt.event.MouseEvent[MOUSE_RELEASED,(261,202),absolute(366,328),button=5,clickCount=1] java.awt.event.MouseEvent[MOUSE_PRESSED,(261,202),absolute(366,328),button=4,extModifiers=Button4,clickCount=1] java.awt.event.MouseEvent[MOUSE_RELEASED,(261,202),absolute(366,328),button=4,clickCount=1] With Java 7 it might be possible to implement a workaround since button 4 and 5 are used to indicate left and right scrolling, but this might be system dependent. I would suggest just to ignore these events for now instead of throwing an exception until Java officially supports horizontal scrolling. -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Issue 207 in piccolo2d: Horizontal scrolling causes an exception
Comment #8 on issue 207 by heue...@gmail.com: Horizontal scrolling causes an exception http://code.google.com/p/piccolo2d/issues/detail?id=207 +1 to ignoring these events for now instead of throwing an exception for the release-1.3 branch. A comment in the Sun bug above describes a workaround for OSX Apple have added a workaround for this in Radar #4631846 - horizontal scrolling creates a MouseWheelEvent with the Shift modifier set. This is a much lower impact method than that specified above and works quite well. Any chance it could be extended across platform? For svn trunk I think Piccolo2D should forward on events to the best of its ability, and add support to e.g. PInputEvent for these platform-specific workarounds, in case clients wish to implement horizontal scrolling on their own. -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Issue 207 in piccolo2d: Horizontal scrolling causes an exception
Comment #5 on issue 207 by nls...@gmail.com: Horizontal scrolling causes an exception http://code.google.com/p/piccolo2d/issues/detail?id=207 Unfortunately, the event does store much information in this case since horizontal scroll wheel support seems not to be implemented in AWT/Swing. I have found this related feature request: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6440198 Currently on my system two events are generated with the following properties: java.awt.event.MouseEvent[MOUSE_PRESSED,(320,295),absolute(425,421),button=0,clickCount=1] java.awt.event.MouseEvent[MOUSE_RELEASED,(320,295),absolute(425,421),button=0,clickCount=1] The methods getModifiers() and getModifiersEx() return 0 for these events. Both events cause an exception, I have only reported the fist one above. -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Issue 207 in piccolo2d: Horizontal scrolling causes an exception
Comment #6 on issue 207 by heue...@gmail.com: Horizontal scrolling causes an exception http://code.google.com/p/piccolo2d/issues/detail?id=207 I found a comment on http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6440198 Apple have added a workaround for this in Radar #4631846 - horizontal scrolling creates a MouseWheelEvent with the Shift modifier set. This is a much lower impact method than that specified above and works quite well. Any chance it could be extended across platform? We could look for this as a workaround on OSX. -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Issue 207 in piccolo2d: Horizontal scrolling causes an exception
Updates: Status: Accepted Owner: heue...@gmail.com Labels: Type-Defect Priority-Medium Effort-Low OpSys-All Toolkit-Piccolo2D.Java Component-Core Milestone-1.3.2 Comment #3 on issue 207 by heue...@gmail.com: Horizontal scrolling causes an exception http://code.google.com/p/piccolo2d/issues/detail?id=207 I would assert Piccolo2D shouldn't throw an exception if getButton() returns MouseEvent.NOBUTTON then. There may be some confusion between MouseEvent.MOUSE_DRAGGED and MouseEvent.MOUSE_MOVED though, see e.g. PCanvas.java, lines 729-734 and 744-749. -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Issue 207 in piccolo2d: Horizontal scrolling causes an exception
Comment #4 on issue 207 by atdi...@gmail.com: Horizontal scrolling causes an exception http://code.google.com/p/piccolo2d/issues/detail?id=207 Line 761 creates the button value based on the raw event's getModifiers() (see call to copyButtonsFromModifiers). For the device you are talking about, does event.getModifiers() or event.getModifiersEx() give any indication of a special button press? Maybe there is a natural translation from that to some state we can track... -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Issue 207 in piccolo2d: Horizontal scrolling causes an exception
Comment #2 on issue 207 by nls...@googlemail.com: Horizontal scrolling causes an exception http://code.google.com/p/piccolo2d/issues/detail?id=207 Good point, actually horizontal scrolling does not work with AWT and Swing apps, but it does work in Eclipse. However, other applications do not throw an exception. Horizontal scrolling results in a MouseEvent with getButton() returning MouseEvent.NOBUTTON causing the Piccolo2D conversion process to throw the exception. Maybe this is a Java Swing issue... -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en