Fix touch cursor mode broken

This commit is contained in:
khanhduytran0 2020-10-04 20:39:13 +07:00
parent 1e2821bbb8
commit 99beb3be11

View file

@ -413,6 +413,7 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
} else {
CallbackBridge.mouseX = x;
CallbackBridge.mouseY = y;
CallbackBridge.sendCursorPos(x, y);
if (!rightOverride) {
CallbackBridge.mouseLeft = true;
}
@ -420,7 +421,6 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
if (CallbackBridge.isGrabbing()) {
// It cause hold left mouse while moving camera
// CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 1, x, y);
CallbackBridge.sendCursorPos(x, y);
initialX = x;
initialY = y;
theHandler.sendEmptyMessageDelayed(MainActivity.MSG_LEFT_MOUSE_BUTTON_CHECK, LauncherPreferences.PREF_LONGPRESS_TRIGGER);
@ -434,9 +434,7 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
CallbackBridge.mouseX = x;
CallbackBridge.mouseY = y;
// TODO uncomment after fix wrong trigger
// -TODO uncomment after fix wrong trigger
// CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 0, x, y);
CallbackBridge.sendCursorPos(x, y);
if (!rightOverride) {
@ -470,6 +468,7 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
if (!isTouchInHotbar) {
CallbackBridge.mouseX = x;
CallbackBridge.mouseY = y;
CallbackBridge.sendCursorPos(x, y);
}
break;
}