Selaa lähdekoodia

Mouse wheel and the other two mouse buttons should now also be fixed. Since this is not tested in the NiftyGUI test there's no real of know till a test has been created though. To fix it I just tweaked the appropriate if statements a bit.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7115 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
rac..om 14 vuotta sitten
vanhempi
commit
76ff6bb99f
1 muutettua tiedostoa jossa 4 lisäystä ja 3 poistoa
  1. 4 3
      engine/src/niftygui/com/jme3/niftygui/InputSystemJme.java

+ 4 - 3
engine/src/niftygui/com/jme3/niftygui/InputSystemJme.java

@@ -117,9 +117,10 @@ public class InputSystemJme implements InputSystem, RawInputListener {
 
     public void onMouseMotionEvent(MouseMotionEvent evt) {
         // Only forward the event if there's actual motion involved.
-        // Ignores mouse wheel
+        // No longer ignores mouse wheel
         if (inputManager.isCursorVisible() && (evt.getDX() != 0 ||
-                                               evt.getDY() != 0)){
+                                               evt.getDY() != 0 ||
+                                               evt.getDeltaWheel() != 0)){
             inputQueue.add(evt);
         }
     }
@@ -142,7 +143,7 @@ public class InputSystemJme implements InputSystem, RawInputListener {
     }
 
     public void onMouseButtonEvent(MouseButtonEvent evt) {
-        if (inputManager.isCursorVisible() && evt.getButtonIndex() == 0){
+        if (inputManager.isCursorVisible() && evt.getButtonIndex() >= 0 || evt.getButtonIndex() <= 2){
             inputQueue.add(evt);
         }
     }