Merge branch 'v3_openjdk' of https://github.com/PojavLauncherTeam/PojavLauncher into v3_openjdk

This commit is contained in:
khanhduytran0 2020-12-07 16:32:02 +07:00
commit 90c66e555e
2 changed files with 23 additions and 17 deletions

View File

@ -2,10 +2,9 @@
[![Crowdin](https://badges.crowdin.net/pojavlauncher/localized.svg)](https://crowdin.com/project/pojavlauncher)
[![Discord](https://img.shields.io/discord/724163890803638273.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/6RpEJda)
# PojavLauncher
A Minecraft: Java Edition launcher for Android based on [Boardwalk](https://github.com/zhuowei/Boardwalk).
## Navigation
- [Introduction](#mainly-features-on-v3)
- [Introduction](#introduction)
- [Building](#building)
- [Current status](#current-status)
- [License](#license)
@ -13,12 +12,21 @@ A Minecraft: Java Edition launcher for Android based on [Boardwalk](https://gith
- [Credits & Third party components and it's licenses](#credits--third-party-components-and-its-licenses)
## Mainly features on v3
- Launch Minecraft 1.6 to latest 1.17 snapshot.
- Launch Forge up to 1.13.2. To install Forge 1.12.2 and below, simply put to mod install launcher. For Forge 1.13.2, use custom arguments.
- Launch Fabric any versions. [How to install Fabric](https://github.com/PojavLauncherTeam/PojavLauncher/wiki/Install-Fabric).
## Introduction
PojavLauncher is a Minecraft: Java Edition launcher for Android based on [Boardwalk](https://github.com/zhuowei/Boardwalk). This launcher can launch a variety large of Minecraft versions (from 1.6 to latest 1.17 snapshot, even Combat Test versions). Modding via Forge and Fabric is also supported, but Forge is currently limited to 1.13.2 and below.
## Building
Will be moved to **BUILDING.md**
### Java Runtime Environment (JRE)
- JRE for Android is [here](https://github.com/PojavLauncherTeam/openjdk-multiarch-jdk8u), also the build script [here](https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch).
- Follow build instruction on build script [README.md](https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch/blob/buildjre8/README.md).
- You can also get [CI auto builds](https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch/actions).
- Spliting JRE and put to the launcher: **coming soon**.
### LWJGL and GLFW
- **Coming soon**
### The Launcher
- Because languages are auto added by Crowdin, so need to run language list generator before build. In this directory, run:
```
# On Linux, Mac OS:

View File

@ -145,9 +145,6 @@ public class AndroidLWJGLKeycode {
androidToLwjglMap.put(KeyEvent.KEYCODE_SPACE, LWJGLGLFWKeycode.GLFW_KEY_SPACE);
// androidToLwjglMap.put(KeyEvent.KEYCODE_SYSRQ, LWJGLGLFWKeycode.GLFW_KEY_SYSRQ);
androidToLwjglMap.put(KeyEvent.KEYCODE_TAB, LWJGLGLFWKeycode.GLFW_KEY_TAB);
androidToLwjglMap.put(KeyEvent.KEYCODE_UNKNOWN, -1 /* LWJGLGLFWKeycode.GLFW_KEY_UNKNOWN */);
// androidToLwjglMap.put(KeyEvent.KEYCODE_YEN, LWJGLGLFWKeycode.GLFW_KEY_YEN);
// androidToLwjglMap.put(KeyEvent.KEYCODE_BUTTON_1, LWJGLGLFWKeycode.G
@ -165,12 +162,14 @@ public class AndroidLWJGLKeycode {
}
public static void execKey(KeyEvent keyEvent, int i, boolean isDown) {
if (i == 1 && (keyEvent.getSource() == InputDevice.SOURCE_MOUSE)) {
// Right mouse detection
BaseMainActivity.sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, isDown);
// BaseMainActivity.sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, false);
} else {
BaseMainActivity.sendKeyPress(androidToLwjglMap.get(i), keyEvent.getModifiers(), isDown);
for (Map.Entry<Integer, Integer> perKey : androidToLwjglMap.entrySet()) {
if (i == 1 && (keyEvent.getSource() == InputDevice.SOURCE_MOUSE)) {
// Right mouse detection
BaseMainActivity.sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, isDown);
// BaseMainActivity.sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, false);
} else if (perKey.getKey() == i) {
BaseMainActivity.sendKeyPress(perKey.getValue(), keyEvent.getModifiers(), isDown);
}
}
int mods = 0;
@ -200,7 +199,7 @@ public class AndroidLWJGLKeycode {
th.printStackTrace();
}
if (isBackspaceAfterChar && (keyEvent.getDisplayLabel() + keyEvent.getUnicodeChar()) != KeyEvent.KEYCODE_UNKNOWN && !CallbackBridge.isGrabbing() && i != KeyEvent.KEYCODE_DEL) {
if (isBackspaceAfterChar && (int) keyEvent.getDisplayLabel() != KeyEvent.KEYCODE_UNKNOWN && !CallbackBridge.isGrabbing() && i != KeyEvent.KEYCODE_DEL) {
BaseMainActivity.sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_BACKSPACE, 0, isDown);
}
}
@ -224,4 +223,3 @@ public class AndroidLWJGLKeycode {
return 0;
}
}