mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-20 05:20:14 -07:00
Fix cursor not working on grab mode; Add GLFW action sendGrabInitialPosUnset()
This commit is contained in:
parent
62a4c140f8
commit
3527d307f7
2 changed files with 9 additions and 0 deletions
|
|
@ -435,6 +435,7 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
|
||||||
if (CallbackBridge.isGrabbing()) {
|
if (CallbackBridge.isGrabbing()) {
|
||||||
// It cause hold left mouse while moving camera
|
// It cause hold left mouse while moving camera
|
||||||
// CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 1, x, y);
|
// CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 1, x, y);
|
||||||
|
CallbackBridge.sendCursorPos(x, y);
|
||||||
initialX = x;
|
initialX = x;
|
||||||
initialY = y;
|
initialY = y;
|
||||||
theHandler.sendEmptyMessageDelayed(MainActivity.MSG_LEFT_MOUSE_BUTTON_CHECK, LauncherPreferences.PREF_LONGPRESS_TRIGGER);
|
theHandler.sendEmptyMessageDelayed(MainActivity.MSG_LEFT_MOUSE_BUTTON_CHECK, LauncherPreferences.PREF_LONGPRESS_TRIGGER);
|
||||||
|
|
@ -447,6 +448,8 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
|
||||||
if (!isTouchInHotbar) {
|
if (!isTouchInHotbar) {
|
||||||
CallbackBridge.mouseX = x;
|
CallbackBridge.mouseX = x;
|
||||||
CallbackBridge.mouseY = y;
|
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.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 0, x, y);
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ public class CallbackBridge {
|
||||||
public static final int JRE_TYPE_KEYCODE_CHAR = 3;
|
public static final int JRE_TYPE_KEYCODE_CHAR = 3;
|
||||||
public static final int JRE_TYPE_MOUSE_KEYCODE_CONTROL = 4;
|
public static final int JRE_TYPE_MOUSE_KEYCODE_CONTROL = 4;
|
||||||
public static final int JRE_TYPE_WINDOW_SIZE = 5;
|
public static final int JRE_TYPE_WINDOW_SIZE = 5;
|
||||||
|
public static final int JRE_TYPE_GRAB_INITIAL_POS_UNSET = 6;
|
||||||
|
|
||||||
public static final int ANDROID_TYPE_GRAB_STATE = 0;
|
public static final int ANDROID_TYPE_GRAB_STATE = 0;
|
||||||
|
|
||||||
|
|
@ -36,6 +37,11 @@ public class CallbackBridge {
|
||||||
mouseY = y;
|
mouseY = y;
|
||||||
sendData(JRE_TYPE_CURSOR_POS, x, y);
|
sendData(JRE_TYPE_CURSOR_POS, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void sendGrabInitialPosUnset() {
|
||||||
|
DEBUG_STRING.append("Grab initial posititon uset");
|
||||||
|
sendData(JRE_TYPE_GRAB_INITIAL_POS_UNSET);
|
||||||
|
}
|
||||||
|
|
||||||
public static void sendKeycode(int keycode, char keychar, int modifiers, boolean isDown) {
|
public static void sendKeycode(int keycode, char keychar, int modifiers, boolean isDown) {
|
||||||
DEBUG_STRING.append("KeyCode=" + keycode + ", Char=" + keychar);
|
DEBUG_STRING.append("KeyCode=" + keycode + ", Char=" + keychar);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue