diff options
author | Sven Gothel <[email protected]> | 2011-12-02 07:54:41 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-12-02 07:54:41 +0100 |
commit | 30c959a4534bc0c6b4718ae65fd4f91d68d6eca6 (patch) | |
tree | 09d676201680f6a670385c8e5f78d23b4eea9955 /src/newt/classes/com | |
parent | 4856f7800bac165c3770495b77de4a2eabcca46e (diff) |
NEWT EVENT_MOUSE_WHEEL_MOVED: Fix Bug 413 - Generate proper mouse wheel events.
> 0: UP
< 0: DOWN
See MouseEvent.getWheelRotation() for details.
OSX/Windows: Default to wheel 'button' 1
OSX: Properly report '<0'
X11: Synthesize wheel events by mapping buttons 4/5 and 6/7 to wheel 1 and 2.
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/event/MouseEvent.java | 14 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/event/MouseListener.java | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java index ccc674f1d..9bc3be1e5 100644 --- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java +++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java @@ -139,6 +139,20 @@ public class MouseEvent extends InputEvent return pressure[index]; } + /** + * <i>Usually</i> a wheel rotation of <b>> 0 is up</b>, + * and <b>< 0 is down</b>.<br> + * <i>However</i>, on some OS this might be flipped due to the OS <i>default</i> behavior. + * The latter is true for OS X 10.7 (Lion) for example. + * <p> + * The events will be send usually in steps of one, ie. <i>-1</i> and <i>1</i>. + * Higher values may result due to fast scrolling. + * </p> + * <p> + * The button number refers to the wheel number. + * </p> + * @return + */ public int getWheelRotation() { return wheelRotation; } diff --git a/src/newt/classes/com/jogamp/newt/event/MouseListener.java b/src/newt/classes/com/jogamp/newt/event/MouseListener.java index 5ec086b94..7668b755c 100644 --- a/src/newt/classes/com/jogamp/newt/event/MouseListener.java +++ b/src/newt/classes/com/jogamp/newt/event/MouseListener.java @@ -43,6 +43,8 @@ public interface MouseListener extends NEWTEventListener public void mouseReleased(MouseEvent e); public void mouseMoved(MouseEvent e); public void mouseDragged(MouseEvent e); + + /** See {@link MouseEvent#getWheelRotation() } */ public void mouseWheelMoved(MouseEvent e); } |