|
|
@ -13,6 +13,7 @@ import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
|
|
public class EventController {
|
|
|
|
public class EventController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final Device device;
|
|
|
|
private final InputManager inputManager;
|
|
|
|
private final InputManager inputManager;
|
|
|
|
private final DesktopConnection connection;
|
|
|
|
private final DesktopConnection connection;
|
|
|
|
|
|
|
|
|
|
|
@ -22,9 +23,10 @@ public class EventController {
|
|
|
|
private final MotionEvent.PointerProperties[] pointerProperties = { new MotionEvent.PointerProperties() };
|
|
|
|
private final MotionEvent.PointerProperties[] pointerProperties = { new MotionEvent.PointerProperties() };
|
|
|
|
private final MotionEvent.PointerCoords[] pointerCoords = { new MotionEvent.PointerCoords() };
|
|
|
|
private final MotionEvent.PointerCoords[] pointerCoords = { new MotionEvent.PointerCoords() };
|
|
|
|
|
|
|
|
|
|
|
|
public EventController(DesktopConnection connection) {
|
|
|
|
public EventController(Device device, DesktopConnection connection) {
|
|
|
|
|
|
|
|
this.device = device;
|
|
|
|
this.connection = connection;
|
|
|
|
this.connection = connection;
|
|
|
|
inputManager = Device.getInstance().getInputManager();
|
|
|
|
inputManager = device.getInputManager();
|
|
|
|
initPointer();
|
|
|
|
initPointer();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -102,7 +104,7 @@ public class EventController {
|
|
|
|
if (action == MotionEvent.ACTION_DOWN) {
|
|
|
|
if (action == MotionEvent.ACTION_DOWN) {
|
|
|
|
lastMouseDown = now;
|
|
|
|
lastMouseDown = now;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Point point = Device.getInstance().getPhysicalPoint(position);
|
|
|
|
Point point = device.getPhysicalPoint(position);
|
|
|
|
if (point == null) {
|
|
|
|
if (point == null) {
|
|
|
|
// ignore event
|
|
|
|
// ignore event
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -114,7 +116,7 @@ public class EventController {
|
|
|
|
|
|
|
|
|
|
|
|
private boolean injectScroll(Position position, int hScroll, int vScroll) {
|
|
|
|
private boolean injectScroll(Position position, int hScroll, int vScroll) {
|
|
|
|
long now = SystemClock.uptimeMillis();
|
|
|
|
long now = SystemClock.uptimeMillis();
|
|
|
|
Point point = Device.getInstance().getPhysicalPoint(position);
|
|
|
|
Point point = device.getPhysicalPoint(position);
|
|
|
|
if (point == null) {
|
|
|
|
if (point == null) {
|
|
|
|
// ignore event
|
|
|
|
// ignore event
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|