mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-13 06:39:54 -04:00
Add debug mouse event use stack trace (will lag) then
This commit is contained in:
parent
20eafa0a64
commit
004626b568
@ -18,7 +18,7 @@ public class CallbackBridge {
|
|||||||
public static boolean mouseLeft;
|
public static boolean mouseLeft;
|
||||||
public static StringBuilder DEBUG_STRING = new StringBuilder();
|
public static StringBuilder DEBUG_STRING = new StringBuilder();
|
||||||
|
|
||||||
volatile private static boolean isGrabbing = false;
|
// volatile private static boolean isGrabbing = false;
|
||||||
|
|
||||||
public static void putMouseEventWithCoords(int button, int state, int x, int y, int dz, long nanos) {
|
public static void putMouseEventWithCoords(int button, int state, int x, int y, int dz, long nanos) {
|
||||||
sendCursorPos(x, y);
|
sendCursorPos(x, y);
|
||||||
@ -39,6 +39,7 @@ public class CallbackBridge {
|
|||||||
|
|
||||||
public static void sendMouseKeycode(int keycode, int modifiers, boolean isDown) {
|
public static void sendMouseKeycode(int keycode, int modifiers, boolean isDown) {
|
||||||
DEBUG_STRING.append("MouseKey=" + keycode + ", down=" + isDown + "\n");
|
DEBUG_STRING.append("MouseKey=" + keycode + ", down=" + isDown + "\n");
|
||||||
|
if (isGrabbing()) DEBUG_STRING.append("MouseGrabStrace: " + android.util.Log.getStackTraceString(new Throwable()) + "\n");
|
||||||
sendData(JRE_TYPE_MOUSE_KEYCODE_CONTROL, keycode, Boolean.toString(isDown), modifiers);
|
sendData(JRE_TYPE_MOUSE_KEYCODE_CONTROL, keycode, Boolean.toString(isDown), modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ public class CallbackBridge {
|
|||||||
public static void receiveCallback(int type, String data) {
|
public static void receiveCallback(int type, String data) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ANDROID_TYPE_GRAB_STATE:
|
case ANDROID_TYPE_GRAB_STATE:
|
||||||
isGrabbing = Boolean.parseBoolean(data);
|
// isGrabbing = Boolean.parseBoolean(data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user