mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-10 13:16:04 -04:00
Fix double letters on MC 1.9 and above
This commit is contained in:
parent
5932f03a03
commit
7e98ecfd41
@ -7,7 +7,7 @@ import org.lwjgl.input.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
public class AndroidLWJGLKeycode {
|
||||
// public static boolean isSendChar;
|
||||
public static boolean isBackspaceAfterChar;
|
||||
private static final Map<Integer, Integer> androidToLwjglMap;
|
||||
static {
|
||||
androidToLwjglMap = new ArrayMap<Integer, Integer>();
|
||||
@ -119,15 +119,8 @@ public class AndroidLWJGLKeycode {
|
||||
|
||||
public static void execKey(MainActivity mainActivity, KeyEvent keyEvent, int i, boolean isDown) {
|
||||
try {
|
||||
// Old method works without dead chars:
|
||||
/*
|
||||
if (isDown) {
|
||||
mainActivity.sendKeyPress((char) keyEvent.getUnicodeChar());
|
||||
}
|
||||
*/
|
||||
System.out.println("Sending key as char: " + ((char) keyEvent.getUnicodeChar()));
|
||||
// if (isSendChar)
|
||||
mainActivity.sendKeyPress(0, (char) keyEvent.getUnicodeChar(), isDown);
|
||||
mainActivity.sendKeyPress(0, (char) keyEvent.getUnicodeChar(), isDown);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
@ -137,6 +130,10 @@ public class AndroidLWJGLKeycode {
|
||||
mainActivity.sendKeyPress(perKey.getValue(), isDown);
|
||||
}
|
||||
}
|
||||
|
||||
if (isBackspaceAfterChar) {
|
||||
mainActivity.sendKeyPress(Keyboard.KEY_BACK, isDown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -744,7 +744,7 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
jvmArgs.add("-Xmx1G");
|
||||
*/
|
||||
Intent mainIntent = new Intent(MCLauncherActivity.this, MainActivity.class);
|
||||
mainIntent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT);
|
||||
// mainIntent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT);
|
||||
mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
mainIntent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
if (PojavPreferenceActivity.PREF_FREEFORM) {
|
||||
|
@ -258,7 +258,7 @@ public class MainActivity extends Activity implements OnTouchListener
|
||||
|
||||
this.drawerLayout.closeDrawers();
|
||||
|
||||
// AndroidLWJGLKeycode.isSendChar = mVersionInfo.minimumLauncherVersion < 18;
|
||||
AndroidLWJGLKeycode.isBackspaceAfterChar = mVersionInfo.minimumLauncherVersion >= 18;
|
||||
|
||||
placeMouseAt(AndroidDisplay.windowWidth / 2, AndroidDisplay.windowHeight / 2);
|
||||
new Thread(new Runnable(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user