diff options
author | Julien Gouesse <[email protected]> | 2013-06-18 20:10:28 +0200 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2013-06-18 20:10:28 +0200 |
commit | 94d76930a7ab3f1ad940763f1bc839953e688f38 (patch) | |
tree | 5dcebf5eeefe7c5ca473e4bcbe5251730e7ef5ac /ardor3d-jogl/src/main/java/com | |
parent | fe3b0da9d1f539ea2bd3809a71345195a761404d (diff) |
Adds the support of 9 mouse buttons into the JOGL 2.0 NEWT backend
Diffstat (limited to 'ardor3d-jogl/src/main/java/com')
-rw-r--r-- | ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtMouseWrapper.java | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtMouseWrapper.java b/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtMouseWrapper.java index 182e769..4fe54c5 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtMouseWrapper.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtMouseWrapper.java @@ -30,9 +30,9 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Multiset; import com.google.common.collect.PeekingIterator; -import com.jogamp.newt.event.InputEvent; import com.jogamp.newt.event.MouseEvent; import com.jogamp.newt.event.MouseListener; +import com.jogamp.newt.event.NEWTEvent; import com.jogamp.newt.opengl.GLWindow; public class JoglNewtMouseWrapper implements MouseWrapper, MouseListener { @@ -104,7 +104,7 @@ public class JoglNewtMouseWrapper implements MouseWrapper, MouseListener { initState(me); if (_consumeEvents) { - me.setAttachment(InputEvent.consumedTag); + me.setAttachment(NEWTEvent.consumedTag); } final EnumMap<MouseButton, ButtonState> buttons = _lastState.getButtonStates(); @@ -118,7 +118,7 @@ public class JoglNewtMouseWrapper implements MouseWrapper, MouseListener { public synchronized void mouseReleased(final MouseEvent me) { initState(me); if (_consumeEvents) { - me.setAttachment(InputEvent.consumedTag); + me.setAttachment(NEWTEvent.consumedTag); } final EnumMap<MouseButton, ButtonState> buttons = _lastState.getButtonStates(); @@ -151,7 +151,7 @@ public class JoglNewtMouseWrapper implements MouseWrapper, MouseListener { // check that we have a valid _lastState initState(me); if (_consumeEvents) { - me.setAttachment(InputEvent.consumedTag); + me.setAttachment(NEWTEvent.consumedTag); } // remember our current ardor3d position @@ -206,7 +206,7 @@ public class JoglNewtMouseWrapper implements MouseWrapper, MouseListener { addNewState(me, _lastState.getButtonStates(), null); if (_consumeEvents) { - me.setAttachment(InputEvent.consumedTag); + me.setAttachment(NEWTEvent.consumedTag); } } @@ -263,6 +263,24 @@ public class JoglNewtMouseWrapper implements MouseWrapper, MouseListener { case MouseEvent.BUTTON3: button = MouseButton.RIGHT; break; + case MouseEvent.BUTTON4: + button = MouseButton.FOUR; + break; + case MouseEvent.BUTTON5: + button = MouseButton.FIVE; + break; + case MouseEvent.BUTTON6: + button = MouseButton.SIX; + break; + case MouseEvent.BUTTON7: + button = MouseButton.SEVEN; + break; + case MouseEvent.BUTTON8: + button = MouseButton.EIGHT; + break; + case MouseEvent.BUTTON9: + button = MouseButton.NINE; + break; default: throw new RuntimeException("unknown button: " + me.getButton()); } |