mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-20 13:30:15 -07:00
Fix y inveryed
This commit is contained in:
parent
d218a04b68
commit
feb2eff4c3
2 changed files with 12 additions and 8 deletions
|
|
@ -416,8 +416,10 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||||
if (hudKeyHandled != -1) {
|
if (hudKeyHandled != -1) {
|
||||||
sendKeyPress(hudKeyHandled);
|
sendKeyPress(hudKeyHandled);
|
||||||
} else {
|
} else {
|
||||||
CallbackBridge.sendCursorPos(x, y);
|
CallbackBridge.sendMouseEvent(
|
||||||
CallbackBridge.sendMouseKeycode(rightOverride ? LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT : LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT);
|
x, CallbackBridge.windowHeight - y,
|
||||||
|
rightOverride ? LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT : LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT
|
||||||
|
);
|
||||||
if (!rightOverride) {
|
if (!rightOverride) {
|
||||||
CallbackBridge.mouseLeft = true;
|
CallbackBridge.mouseLeft = true;
|
||||||
}
|
}
|
||||||
|
|
@ -434,10 +436,12 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||||
|
|
||||||
theHandler.sendEmptyMessageDelayed(MainActivity.MSG_DROP_ITEM_BUTTON_CHECK, LauncherPreferences.PREF_LONGPRESS_TRIGGER);
|
theHandler.sendEmptyMessageDelayed(MainActivity.MSG_DROP_ITEM_BUTTON_CHECK, LauncherPreferences.PREF_LONGPRESS_TRIGGER);
|
||||||
} else {
|
} else {
|
||||||
CallbackBridge.sendCursorPos(x, y);
|
CallbackBridge.sendCursorPos(x, CallbackBridge.windowHeight - y);
|
||||||
|
/*
|
||||||
if (!rightOverride) {
|
if (!rightOverride) {
|
||||||
// CallbackBridge.mouseLeft = true;
|
CallbackBridge.mouseLeft = true;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if (CallbackBridge.isGrabbing()) {
|
if (CallbackBridge.isGrabbing()) {
|
||||||
CallbackBridge.sendMouseKeycode(rightOverride ? LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT : LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT, true);
|
CallbackBridge.sendMouseKeycode(rightOverride ? LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT : LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT, true);
|
||||||
|
|
@ -451,7 +455,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||||
case MotionEvent.ACTION_CANCEL: // 3
|
case MotionEvent.ACTION_CANCEL: // 3
|
||||||
case MotionEvent.ACTION_POINTER_UP: // 6
|
case MotionEvent.ACTION_POINTER_UP: // 6
|
||||||
if (!isTouchInHotbar) {
|
if (!isTouchInHotbar) {
|
||||||
CallbackBridge.sendCursorPos(x, y);
|
CallbackBridge.sendCursorPos(x, CallbackBridge.windowHeight - y);
|
||||||
|
|
||||||
// TODO uncomment after fix wrong trigger
|
// TODO uncomment after fix wrong trigger
|
||||||
// CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 0, x, y, 0, System.nanoTime());
|
// CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 0, x, y, 0, System.nanoTime());
|
||||||
|
|
@ -484,7 +488,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (!isTouchInHotbar) {
|
if (!isTouchInHotbar) {
|
||||||
CallbackBridge.sendCursorPos(x, y);
|
CallbackBridge.sendCursorPos(x, CallbackBridge.windowHeight - y);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ public class CallbackBridge {
|
||||||
|
|
||||||
public static final int ANDROID_TYPE_GRAB_STATE = 0;
|
public static final int ANDROID_TYPE_GRAB_STATE = 0;
|
||||||
|
|
||||||
public static int windowWidth, windowHeight;
|
public static volatile int windowWidth, windowHeight;
|
||||||
public static int mouseX, mouseY;
|
public static int mouseX, mouseY;
|
||||||
public static boolean mouseLeft;
|
public static boolean mouseLeft;
|
||||||
public static StringBuilder DEBUG_STRING = new StringBuilder();
|
public static StringBuilder DEBUG_STRING = new StringBuilder();
|
||||||
|
|
@ -32,7 +32,7 @@ public class CallbackBridge {
|
||||||
public static void sendCursorPos(int x, int y) {
|
public static void sendCursorPos(int x, int y) {
|
||||||
DEBUG_STRING.append("CursorPos=" + x + ", " + y + "\n");
|
DEBUG_STRING.append("CursorPos=" + x + ", " + y + "\n");
|
||||||
mouseX = x;
|
mouseX = x;
|
||||||
mouseY = windowHeight - y;
|
mouseY = y;
|
||||||
sendData(JRE_TYPE_CURSOR_POS, x + ":" + y);
|
sendData(JRE_TYPE_CURSOR_POS, x + ":" + y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue