Parcourir la source

Added infinite scrolling

Kenneth van Ewijk il y a 10 ans
Parent
commit
5b5f4e0ce1
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      control/joystick/JoystickHandler.java

+ 3 - 2
control/joystick/JoystickHandler.java

@@ -23,6 +23,7 @@ public class JoystickHandler implements KeyListener{
 
 	List<JoystickListener> listeners;
 	Set<Integer> keys;
+	public static boolean REPEAT = false;
 	public static Joystick j = new Joystick();;
 	
 	public JoystickHandler()
@@ -157,7 +158,7 @@ public class JoystickHandler implements KeyListener{
 			keys.add(e.getKeyCode());
 			updateJoystickPosition();
 			
-			if(!keys.equals(keysCopy))
+			if(REPEAT || !keys.equals(keysCopy) )
 			{
 				onJoystickMoved(j);				
 			}
@@ -173,7 +174,7 @@ public class JoystickHandler implements KeyListener{
 			keys.remove(e.getKeyCode());
 			updateJoystickPosition();
 			
-			if(!keys.equals(keysCopy))
+			if(REPEAT || !keys.equals(keysCopy))
 			{
 				onJoystickMoved(j);				
 			}