Input debug

This commit is contained in:
khanhduytran0 2020-09-17 12:37:35 +07:00
parent dc327a1845
commit b83813c79f
2 changed files with 7 additions and 2 deletions

View File

@ -21,7 +21,7 @@ public class CallbackBridge {
public static void sendMouseEvent(int x, int y, int keycode, boolean isDown) {
sendCursorPos(x, y);
sendKeycode(keycode, isDown);
sendMouseKeycode(keycode, isDown);
}
public static void sendCursorPos(int x, int y) {
@ -56,7 +56,9 @@ public class CallbackBridge {
// Called from JRE side
public static void receiveCallback(int type, String data) {
switch (type) {
case ANDROID_TYPE_GRAB_STATE: isGrabbing = Boolean.parseBoolean(data);
case ANDROID_TYPE_GRAB_STATE:
isGrabbing = Boolean.parseBoolean(data);
break;
}
}

View File

@ -37,8 +37,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_sendData(JNIEnv* env,
return;
}
printf("[SendData] type=%i, isJVMNull=%p\n", type, secondJavaVM == null);
if (secondJavaVM != NULL) {
char *data_c = (char*)(*env)->GetStringUTFChars(env, data, 0);
printf("data=%s\n", data_c);
jstring data_jre = (*secondJNIEnv)->NewStringUTF(secondJNIEnv, data_c);
(*env)->ReleaseStringUTFChars(env, data, data_c);