Minor cleanup of mouse / keyboard methods for touch.

Depreciated InputManager.getSimluateMouse and replaced with InputManager.isSimulateMouse for consistancy.
Removed depreciated TouchInput.getSimulateMouse().
Added InputManager.isSimulateKeyboard() to keep consistancy with mouse methods.
experimental
iwgeric 10 years ago
parent a116389814
commit a55aae21f9
  1. 4
      jme3-android/src/main/java/com/jme3/input/android/AndroidInputHandler.java
  2. 27
      jme3-core/src/main/java/com/jme3/input/InputManager.java
  3. 7
      jme3-core/src/main/java/com/jme3/input/TouchInput.java
  4. 5
      jme3-ios/src/main/java/com/jme3/input/ios/IosInputHandler.java

@ -242,10 +242,6 @@ public class AndroidInputHandler implements TouchInput {
return mouseEventsEnabled; return mouseEventsEnabled;
} }
public boolean getSimulateMouse() {
return mouseEventsEnabled;
}
public boolean isMouseEventsInvertX() { public boolean isMouseEventsInvertX() {
return mouseEventsInvertX; return mouseEventsInvertX;
} }

@ -764,12 +764,25 @@ public class InputManager implements RawInputListener {
} }
} }
/** /**
* @deprecated Use isSimulateMouse
* Returns state of simulation of mouse events. Used for touchscreen input only. * Returns state of simulation of mouse events. Used for touchscreen input only.
* *
*/ */
public boolean getSimulateMouse() { public boolean getSimulateMouse() {
if (touch != null) { if (touch != null) {
return touch.getSimulateMouse(); return touch.isSimulateMouse();
} else {
return false;
}
}
/**
* Returns state of simulation of mouse events. Used for touchscreen input only.
*
*/
public boolean isSimulateMouse() {
if (touch != null) {
return touch.isSimulateMouse();
} else { } else {
return false; return false;
} }
@ -786,6 +799,18 @@ public class InputManager implements RawInputListener {
} }
} }
/**
* Returns state of simulation of key events. Used for touchscreen input only.
*
*/
public boolean isSimulateKeyboard() {
if (touch != null) {
return touch.isSimulateKeyboard();
} else {
return false;
}
}
private void processQueue() { private void processQueue() {
int queueSize = inputQueue.size(); int queueSize = inputQueue.size();
RawInputListener[] array = getRawListenerArray(); RawInputListener[] array = getRawListenerArray();

@ -73,13 +73,6 @@ public interface TouchInput extends Input {
*/ */
public void setSimulateMouse(boolean simulate); public void setSimulateMouse(boolean simulate);
/**
* Get if mouse events are generated
* @deprecated Use {@link #isSimulateMouse() }.
*/
@Deprecated
public boolean getSimulateMouse();
/** /**
* @return true if mouse event simulation is enabled, false otherwise. * @return true if mouse event simulation is enabled, false otherwise.
*/ */

@ -97,11 +97,6 @@ public class IosInputHandler implements TouchInput {
this.mouseEventsEnabled = simulate; this.mouseEventsEnabled = simulate;
} }
@Override
public boolean getSimulateMouse() {
return mouseEventsEnabled;
}
@Override @Override
public boolean isSimulateMouse() { public boolean isSimulateMouse() {
return mouseEventsEnabled; return mouseEventsEnabled;

Loading…
Cancel
Save