diff options
author | Julien Gouesse <[email protected]> | 2013-06-26 20:08:40 +0200 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2013-06-26 20:08:40 +0200 |
commit | d9d66acb316d771c4d35af82f4bbb75b375a49be (patch) | |
tree | 9cb9b4bcf0a304e291f752fd6a42d4404dc6814d /ardor3d-jogl/src/main/java | |
parent | e3b3dc7fba36631973aa477fbb77acb9b6420c66 (diff) |
Switches to JOGL 2.0.2 RC12
Diffstat (limited to 'ardor3d-jogl/src/main/java')
-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 |
2 files changed, 6 insertions, 10 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); |