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()) {
|
||||
// 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);
|
||||
|
|
@ -448,6 +449,8 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
|
|||
CallbackBridge.mouseX = x;
|
||||
CallbackBridge.mouseY = y;
|
||||
|
||||
|
||||
|
||||
// TODO uncomment after fix wrong trigger
|
||||
// CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 0, x, y);
|
||||
if (!rightOverride) {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ public class CallbackBridge {
|
|||
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_WINDOW_SIZE = 5;
|
||||
public static final int JRE_TYPE_GRAB_INITIAL_POS_UNSET = 6;
|
||||
|
||||
public static final int ANDROID_TYPE_GRAB_STATE = 0;
|
||||
|
||||
|
|
@ -37,6 +38,11 @@ public class CallbackBridge {
|
|||
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) {
|
||||
DEBUG_STRING.append("KeyCode=" + keycode + ", Char=" + keychar);
|
||||
sendData(JRE_TYPE_KEYCODE_CONTROL, keycode, Character.toString(keychar), Boolean.toString(isDown), modifiers);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue