- Fix keyboard not working in mc 1.13+

- Fix bad handling of KEY_MULTIPLE cases.
This commit is contained in:
SerpentSpirale 2021-08-14 14:34:12 +02:00
parent a89b77c138
commit 292571c00e
2 changed files with 3 additions and 10 deletions

View File

@ -50,7 +50,9 @@ public class TouchCharInput extends androidx.appcompat.widget.AppCompatEditText
}
}else{
for(int i=lengthBefore, index=lengthBefore+start; i < lengthAfter; ++i){
CallbackBridge.sendChar(text.charAt(index));
//I didn't know F25 existed before that. I just need a full fat keycode for mc 1.13+
CallbackBridge.sendKeycode(LWJGLGLFWKeycode.GLFW_KEY_F25, text.charAt(index), 0, 0, true);
index ++;
}
}

View File

@ -80,15 +80,6 @@ public class CallbackBridge {
// sendData(JRE_TYPE_KEYCODE_CONTROL, keycode, Character.toString(keychar), Boolean.toString(isDown), modifiers);
}
/**
* Send only the char to the input bridge
* Intended for chat functions, or anything that only requires writing text
* @param keychar the char to send
*/
public static void sendChar(char keychar){
nativeSendChar(keychar);
}
public static void sendMouseKeycode(int button, int modifiers, boolean isDown) {
DEBUG_STRING.append("MouseKey=").append(button).append(", down=").append(isDown).append("\n");
// if (isGrabbing()) DEBUG_STRING.append("MouseGrabStrace: " + android.util.Log.getStackTraceString(new Throwable()) + "\n");