mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-05-19 07:24:38 -04:00
Move force trigger screen size to GLFW stub side
This commit is contained in:
@@ -631,7 +631,7 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
|
||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||
CallbackBridge.sendPrepareGrabInitialPos();
|
||||
|
||||
CallbackBridge.sendMouseKeycode(!CallbackBridge.mouseLeft ? LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT : LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT, 0, true);
|
||||
CallbackBridge.sendMouseKeycode(CallbackBridge.mouseLeft ? LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT : LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, 0, true);
|
||||
initialX = x;
|
||||
initialY = y;
|
||||
|
||||
|
||||
@@ -29,14 +29,11 @@ public class CallbackBridge {
|
||||
sendMouseKeycode(button, 0, state == 1);
|
||||
}
|
||||
|
||||
private static boolean threadAttached, screenSizeSet;
|
||||
private static boolean threadAttached;
|
||||
public static void sendCursorPos(int x, int y) {
|
||||
if (!threadAttached) {
|
||||
threadAttached = CallbackBridge.nativeAttachThreadToOther(true, isMinecraft1p12, MainActivity.isInputStackCall);
|
||||
}
|
||||
if (!screenSizeSet) {
|
||||
screenSizeSet = nativeSendScreenSize(windowWidth, windowHeight);
|
||||
}
|
||||
|
||||
DEBUG_STRING.append("CursorPos=" + x + ", " + y + "\n");
|
||||
mouseX = x;
|
||||
@@ -136,7 +133,7 @@ public class CallbackBridge {
|
||||
private static native void nativeSendKey(int key, int scancode, int action, int mods);
|
||||
private static native void nativeSendMouseButton(int button, int action, int mods);
|
||||
private static native void nativeSendScroll(double xoffset, double yoffset);
|
||||
private static native boolean nativeSendScreenSize(int width, int height);
|
||||
private static native void nativeSendScreenSize(int width, int height);
|
||||
|
||||
public static native boolean nativeIsGrabbing();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user