diff options
-rw-r--r-- | ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtKeyboardWrapper.java | 13 | ||||
-rw-r--r-- | ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtMouseWrapper.java | 3 | ||||
-rw-r--r-- | pom.xml | 2 |
3 files changed, 7 insertions, 11 deletions
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtKeyboardWrapper.java b/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtKeyboardWrapper.java index be49f25..610736b 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtKeyboardWrapper.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtKeyboardWrapper.java @@ -22,13 +22,13 @@ import com.ardor3d.input.KeyboardWrapper; import com.google.common.base.Preconditions; import com.google.common.collect.AbstractIterator; import com.google.common.collect.PeekingIterator; -import com.jogamp.newt.event.KeyListener; +import com.jogamp.newt.event.KeyAdapter; import com.jogamp.newt.event.NEWTEvent; import com.jogamp.newt.event.WindowAdapter; import com.jogamp.newt.event.WindowEvent; import com.jogamp.newt.opengl.GLWindow; -public class JoglNewtKeyboardWrapper implements KeyboardWrapper, KeyListener { +public class JoglNewtKeyboardWrapper extends KeyAdapter implements KeyboardWrapper { @GuardedBy("this") protected final LinkedList<KeyEvent> _upcomingEvents = new LinkedList<KeyEvent>(); @@ -67,13 +67,7 @@ public class JoglNewtKeyboardWrapper implements KeyboardWrapper, KeyListener { return _currentIterator; } - public synchronized void keyTyped(final com.jogamp.newt.event.KeyEvent e) { - if (_consumeEvents) { - e.setAttachment(NEWTEvent.consumedTag); - // ignore this event - } - } - + @Override public synchronized void keyPressed(final com.jogamp.newt.event.KeyEvent e) { final Key pressed = fromKeyEventToKey(e); if (!_pressedList.contains(pressed)) { @@ -86,6 +80,7 @@ public class JoglNewtKeyboardWrapper implements KeyboardWrapper, KeyListener { } } + @Override public synchronized void keyReleased(final com.jogamp.newt.event.KeyEvent e) { final Key released = fromKeyEventToKey(e); _upcomingEvents.add(new KeyEvent(released, KeyState.UP, e.getKeyChar())); 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 4fe54c5..3abe5f5 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 @@ -219,7 +219,8 @@ public class JoglNewtMouseWrapper implements MouseWrapper, MouseListener { private void addNewState(final MouseEvent mouseEvent, final EnumMap<MouseButton, ButtonState> enumMap, final Multiset<MouseButton> clicks) { final MouseState newState = new MouseState(mouseEvent.getX(), getArdor3DY(mouseEvent), getDX(mouseEvent), - getDY(mouseEvent), (int) mouseEvent.getWheelRotation(), enumMap, clicks); + getDY(mouseEvent), (int) (mouseEvent.isShiftDown() ? mouseEvent.getRotation()[0] + : mouseEvent.getRotation()[1]), enumMap, clicks); synchronized (JoglNewtMouseWrapper.this) { _upcomingEvents.add(newState); @@ -169,7 +169,7 @@ <!-- these properties help simplify specifying some commonly occurring variables --> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <jogamp.version>2.0.2-rc-20130619</jogamp.version> + <jogamp.version>2.0.2-rc12</jogamp.version> <lwjgl.version>2.8.4</lwjgl.version> <swt.version>3650</swt.version> <osgi.project.version>0.9_SNAPSHOT</osgi.project.version> |