diff --git a/app_pojavlauncher/src/main/AndroidManifest.xml b/app_pojavlauncher/src/main/AndroidManifest.xml
index 8bd3f91cd..2830875e8 100644
--- a/app_pojavlauncher/src/main/AndroidManifest.xml
+++ b/app_pojavlauncher/src/main/AndroidManifest.xml
@@ -68,11 +68,6 @@
android:screenOrientation="sensorLandscape"
android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"/>
-
-
diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseMainActivity.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseMainActivity.java
index c92485480..df3d1d6b5 100644
--- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseMainActivity.java
+++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseMainActivity.java
@@ -106,6 +106,8 @@ public class BaseMainActivity extends LoggableActivity {
private boolean lastGrab = false;
private boolean isExited = false;
private boolean isLogAllow = false;
+ private volatile int mouse_x, mouse_y;
+ private boolean ignorePad = false;
// private int navBarHeight = 40;
// private static Collection extends Provider.Service> rsaPkcs1List;
@@ -277,7 +279,11 @@ public class BaseMainActivity extends LoggableActivity {
// and other input controls. In this case, you are only
// interested in events where the touch position changed.
// int index = event.getActionIndex();
-
+ if(CallbackBridge.isGrabbing()) {
+ minecraftGLView.dispatchTouchEvent(MotionEvent.obtain(event));
+ System.out.println("Transitioned event" + event.hashCode() + " to MinecraftGLView");
+ return false;
+ }
int action = event.getActionMasked();
float x = event.getX();
@@ -293,7 +299,8 @@ public class BaseMainActivity extends LoggableActivity {
float mouseY = mousePointer.getTranslationY();
if (gestureDetector.onTouchEvent(event)) {
-
+ mouse_x = (int) (mouseX * scaleFactor);
+ mouse_y = (int) (mouseY * scaleFactor);
CallbackBridge.sendCursorPos((int) (mouseX * scaleFactor), (int) (mouseY *scaleFactor));
CallbackBridge.sendMouseKeycode(rightOverride ? LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT : LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT);
if (!rightOverride) {
@@ -312,8 +319,9 @@ public class BaseMainActivity extends LoggableActivity {
case MotionEvent.ACTION_MOVE: // 2
mouseX = Math.max(0, Math.min(displayMetrics.widthPixels, mouseX + x - prevX));
mouseY = Math.max(0, Math.min(displayMetrics.heightPixels, mouseY + y - prevY));
+ mouse_x = (int) (mouseX * scaleFactor);
+ mouse_y = (int) (mouseY * scaleFactor);
placeMouseAt(mouseX, mouseY);
-
CallbackBridge.sendCursorPos((int) (mouseX * scaleFactor), (int) (mouseY *scaleFactor));
/*
if (!CallbackBridge.isGrabbing()) {
@@ -340,7 +348,6 @@ public class BaseMainActivity extends LoggableActivity {
private boolean isTouchInHotbar = false;
private int hotbarX, hotbarY;
private int scrollInitialX, scrollInitialY;
- private int x,y;
@Override
public boolean onTouch(View p1, MotionEvent e)
{
@@ -353,6 +360,9 @@ public class BaseMainActivity extends LoggableActivity {
}
}
if (mptrIndex != -1) {
+ if(CallbackBridge.isGrabbing()) {
+ return false;
+ }
//handle mouse events by just sending the coords of the new point in touch event
int x = (int) (e.getX(mptrIndex) * scaleFactor);
int y = (int) (e.getY(mptrIndex) * scaleFactor);
@@ -367,12 +377,12 @@ public class BaseMainActivity extends LoggableActivity {
/* int x = ((int) e.getX()) * scaleFactor;
int y = ((int) e.getY()) * scaleFactor;*/
if(e.getHistorySize() > 0 && CallbackBridge.isGrabbing()) {
- x += (int)(e.getX() - e.getHistoricalX(0));
- y += (int)(e.getY() - e.getHistoricalY(0));
+ mouse_x += (int)(e.getX() - e.getHistoricalX(0));
+ mouse_y += (int)(e.getY() - e.getHistoricalY(0));
}
if(!CallbackBridge.isGrabbing()) {
- x = (int) (e.getX() * scaleFactor);
- y = (int) (e.getY() * scaleFactor);
+ mouse_x = (int) (e.getX() * scaleFactor);
+ mouse_y = (int) (e.getY() * scaleFactor);
}
int hudKeyHandled = handleGuiBar((int)e.getX(), (int)e.getY());
@@ -380,7 +390,7 @@ public class BaseMainActivity extends LoggableActivity {
if (hudKeyHandled != -1) {
sendKeyPress(hudKeyHandled);
} else {
- CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0,x,y);
+ CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, mouse_x, mouse_y);
if (!rightOverride) {
CallbackBridge.mouseLeft = true;
}
@@ -399,9 +409,9 @@ public class BaseMainActivity extends LoggableActivity {
theHandler.sendEmptyMessageDelayed(BaseMainActivity.MSG_DROP_ITEM_BUTTON_CHECK, LauncherPreferences.PREF_LONGPRESS_TRIGGER);
} else {
- CallbackBridge.mouseX = x;
- CallbackBridge.mouseY = y;
- CallbackBridge.sendCursorPos(x, y);
+ CallbackBridge.mouseX = mouse_x;
+ CallbackBridge.mouseY = mouse_y;
+ CallbackBridge.sendCursorPos(mouse_x, mouse_y);
if (!rightOverride) {
CallbackBridge.mouseLeft = true;
}
@@ -409,13 +419,13 @@ public class BaseMainActivity extends LoggableActivity {
if (CallbackBridge.isGrabbing()) {
// It cause hold left mouse while moving camera
// CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 1, x, y);
- initialX = x;
- initialY = y;
+ initialX = mouse_x;
+ initialY = mouse_y;
theHandler.sendEmptyMessageDelayed(BaseMainActivity.MSG_LEFT_MOUSE_BUTTON_CHECK, LauncherPreferences.PREF_LONGPRESS_TRIGGER);
}
- scrollInitialX = x;
- scrollInitialY = y;
+ scrollInitialX = mouse_x;
+ scrollInitialY = mouse_y;
}
break;
@@ -423,12 +433,12 @@ public class BaseMainActivity extends LoggableActivity {
case MotionEvent.ACTION_POINTER_UP: // 6
case MotionEvent.ACTION_CANCEL: // 3
if (!isTouchInHotbar) {
- CallbackBridge.mouseX = x;
- CallbackBridge.mouseY = y;
+ CallbackBridge.mouseX = mouse_x;
+ CallbackBridge.mouseY = mouse_y;
// -TODO uncomment after fix wrong trigger
// CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 0, x, y);
- CallbackBridge.sendCursorPos(x, y);
+ CallbackBridge.sendCursorPos(mouse_x, mouse_y);
if (!rightOverride) {
CallbackBridge.mouseLeft = false;
}
@@ -437,9 +447,9 @@ public class BaseMainActivity extends LoggableActivity {
if (CallbackBridge.isGrabbing()) {
// System.out.println((String) ("[Math.abs(" + initialX + " - " + x + ") = " + Math.abs(initialX - x) + "] < " + fingerStillThreshold));
// System.out.println((String) ("[Math.abs(" + initialY + " - " + y + ") = " + Math.abs(initialY - y) + "] < " + fingerStillThreshold));
- if (isTouchInHotbar && Math.abs(hotbarX - x) < fingerStillThreshold && Math.abs(hotbarY - y) < fingerStillThreshold) {
+ if (isTouchInHotbar && Math.abs(hotbarX - mouse_x) < fingerStillThreshold && Math.abs(hotbarY - mouse_y) < fingerStillThreshold) {
sendKeyPress(hudKeyHandled, 0, false);
- } else if (!triggeredLeftMouseButton && Math.abs(initialX - x) < fingerStillThreshold && Math.abs(initialY - y) < fingerStillThreshold) {
+ } else if (!triggeredLeftMouseButton && Math.abs(initialX - mouse_x) < fingerStillThreshold && Math.abs(initialY - mouse_y) < fingerStillThreshold) {
if(!LauncherPreferences.PREF_DISABLE_GESTURES) {
sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, true);
sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, false);
@@ -472,19 +482,19 @@ public class BaseMainActivity extends LoggableActivity {
*/
case MotionEvent.ACTION_MOVE:
if (!isTouchInHotbar) {
- CallbackBridge.mouseX = x;
- CallbackBridge.mouseY = y;
+ CallbackBridge.mouseX = mouse_x;
+ CallbackBridge.mouseY = mouse_y;
- CallbackBridge.sendCursorPos(x, y);
+ CallbackBridge.sendCursorPos(mouse_x, mouse_y);
if (!CallbackBridge.isGrabbing()) {
/*
CallbackBridge.sendMouseKeycode(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT, 0, isLeftMouseDown);
CallbackBridge.sendMouseKeycode(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, 0, isRightMouseDown);
*/
- CallbackBridge.sendScroll(x - scrollInitialX, y - scrollInitialY);
- scrollInitialX = x;
- scrollInitialY = y;
+ CallbackBridge.sendScroll(mouse_x - scrollInitialX, mouse_y - scrollInitialY);
+ scrollInitialX = mouse_x;
+ scrollInitialY = mouse_y;
}
}
break;
@@ -590,7 +600,7 @@ public class BaseMainActivity extends LoggableActivity {
if (isAndroid8OrHigher()) {
minecraftGLView.setDefaultFocusHighlightEnabled(false);
minecraftGLView.setOnCapturedPointerListener(new View.OnCapturedPointerListener() {
- private int x, y;
+ //private int x, y;
private boolean debugErrored = false;
private String getMoving(float pos, boolean xOrY) {
@@ -605,8 +615,12 @@ public class BaseMainActivity extends LoggableActivity {
@Override
public boolean onCapturedPointer (View view, MotionEvent e) {
- x += ((int) e.getX()) * scaleFactor;
- y += ((int) e.getY()) * scaleFactor;
+ if(e.getHistorySize() > 0) {
+ mouse_x += (int)(e.getX()*scaleFactor);
+ mouse_y += (int)(e.getY()*scaleFactor);
+ }
+ CallbackBridge.mouseX = mouse_x;
+ CallbackBridge.mouseY = mouse_y;
if(!CallbackBridge.isGrabbing()){
view.releasePointerCapture();
}
@@ -623,8 +637,8 @@ public class BaseMainActivity extends LoggableActivity {
builder.append("RawX=" + e.getRawX() + "\n");
builder.append("RawY=" + e.getRawY() + "\n\n");
- builder.append("XPos=" + x + "\n");
- builder.append("YPos=" + y + "\n\n");
+ builder.append("XPos=" + mouse_x + "\n");
+ builder.append("YPos=" + mouse_y + "\n\n");
builder.append("MovingX=" + getMoving(e.getX(), true) + "\n");
builder.append("MovingY=" + getMoving(e.getY(), false) + "\n");
} catch (Throwable th) {
@@ -639,7 +653,7 @@ public class BaseMainActivity extends LoggableActivity {
CallbackBridge.DEBUG_STRING.setLength(0);
switch (e.getActionMasked()) {
case MotionEvent.ACTION_MOVE:
- CallbackBridge.sendCursorPos(x, y);
+ CallbackBridge.sendCursorPos(mouse_x, mouse_y);
return true;
case MotionEvent.ACTION_BUTTON_PRESS:
return sendMouseButtonUnconverted(e.getActionButton(), true);
@@ -758,15 +772,18 @@ public class BaseMainActivity extends LoggableActivity {
}
switch(ev.getActionMasked()) {
case MotionEvent.ACTION_HOVER_MOVE:
- CallbackBridge.mouseX = (int) (ev.getX(mouseCursorIndex)*scaleFactor);
- CallbackBridge.mouseY = (int) (ev.getY(mouseCursorIndex)*scaleFactor);
- CallbackBridge.sendCursorPos((int) (ev.getX(mouseCursorIndex)*scaleFactor), (int) (ev.getY(mouseCursorIndex)*scaleFactor));
+ mouse_x = (int) (ev.getX(mouseCursorIndex) * scaleFactor);
+ mouse_y = (int) (ev.getY(mouseCursorIndex) * scaleFactor);
+ CallbackBridge.mouseX = mouse_x;
+ CallbackBridge.mouseY = mouse_y;
+ CallbackBridge.sendCursorPos(mouse_x,mouse_y);
+ debugText.setText(CallbackBridge.DEBUG_STRING.toString());
+ CallbackBridge.DEBUG_STRING.setLength(0);
return true;
case MotionEvent.ACTION_SCROLL:
CallbackBridge.sendScroll((double) ev.getAxisValue(MotionEvent.AXIS_VSCROLL), (double) ev.getAxisValue(MotionEvent.AXIS_HSCROLL));
return true;
case MotionEvent.ACTION_BUTTON_PRESS:
-
return sendMouseButtonUnconverted(ev.getActionButton(),true);
case MotionEvent.ACTION_BUTTON_RELEASE:
return sendMouseButtonUnconverted(ev.getActionButton(),false);
@@ -774,11 +791,13 @@ public class BaseMainActivity extends LoggableActivity {
return false;
}
}
+
}
boolean isKeyboard(KeyEvent evt) {
- if((evt.getFlags() & KeyEvent.FLAG_SOFT_KEYBOARD) == KeyEvent.FLAG_SOFT_KEYBOARD) return true;
- if(evt.getSource() == InputDevice.SOURCE_KEYBOARD) return true;
- if(evt.getUnicodeChar() != 0) return true;
+ System.out.println("Event:" +evt);
+ //if((evt.getFlags() & KeyEvent.FLAG_SOFT_KEYBOARD) == KeyEvent.FLAG_SOFT_KEYBOARD) return true;
+ //if(evt.getSource() == InputDevice.SOURCE_KEYBOARD) return true;
+ //if(evt.getUnicodeChar() != 0) return true;
if(AndroidLWJGLKeycode.androidToLwjglMap.containsKey(evt.getKeyCode())) return true;
return false;
}
diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/ControlButton.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/ControlButton.java
index 1e109ad2e..a85a811ae 100644
--- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/ControlButton.java
+++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/ControlButton.java
@@ -28,6 +28,7 @@ public class ControlButton extends androidx.appcompat.widget.AppCompatButton imp
public ControlButton(ControlLayout layout, ControlData properties) {
super(layout.getContext());
+ setPadding(4, 4, 4, 4);
setWillNotDraw(false);
mScaleAt = layout.mLayout.scaledAt;
diff --git a/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java b/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java
index 6379272fd..3d42cbcca 100644
--- a/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java
+++ b/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java
@@ -56,8 +56,8 @@ public class CallbackBridge {
}
public static void sendPrepareGrabInitialPos() {
- DEBUG_STRING.append("Prepare set grab initial posititon");
- sendMouseKeycode(-1, CallbackBridge.getCurrentMods(), false);
+ DEBUG_STRING.append("Prepare set grab initial posititon: ignored");
+ //sendMouseKeycode(-1, CallbackBridge.getCurrentMods(), false);
}
public static void sendKeycode(int keycode, char keychar, int scancode, int modifiers, boolean isDown) {
diff --git a/app_pojavlauncher/src/main/res/drawable-hdpi/ic_auto_ram.png b/app_pojavlauncher/src/main/res/drawable-hdpi/ic_auto_ram.png
new file mode 100644
index 000000000..30eabde3b
Binary files /dev/null and b/app_pojavlauncher/src/main/res/drawable-hdpi/ic_auto_ram.png differ
diff --git a/app_pojavlauncher/src/main/res/drawable-hdpi/ic_disable_gestures.png b/app_pojavlauncher/src/main/res/drawable-hdpi/ic_disable_gestures.png
new file mode 100644
index 000000000..e19dea899
Binary files /dev/null and b/app_pojavlauncher/src/main/res/drawable-hdpi/ic_disable_gestures.png differ
diff --git a/app_pojavlauncher/src/main/res/drawable-hdpi/ic_flatstyle.png b/app_pojavlauncher/src/main/res/drawable-hdpi/ic_flatstyle.png
new file mode 100644
index 000000000..777730532
Binary files /dev/null and b/app_pojavlauncher/src/main/res/drawable-hdpi/ic_flatstyle.png differ
diff --git a/app_pojavlauncher/src/main/res/drawable-hdpi/ic_lib_check.png b/app_pojavlauncher/src/main/res/drawable-hdpi/ic_lib_check.png
new file mode 100644
index 000000000..a5ac94dc4
Binary files /dev/null and b/app_pojavlauncher/src/main/res/drawable-hdpi/ic_lib_check.png differ
diff --git a/app_pojavlauncher/src/main/res/drawable-hdpi/ic_map_rmb.png b/app_pojavlauncher/src/main/res/drawable-hdpi/ic_map_rmb.png
new file mode 100644
index 000000000..5bdaa3296
Binary files /dev/null and b/app_pojavlauncher/src/main/res/drawable-hdpi/ic_map_rmb.png differ
diff --git a/app_pojavlauncher/src/main/res/xml/pref_main.xml b/app_pojavlauncher/src/main/res/xml/pref_main.xml
index 4ed8abf6e..be8139b20 100644
--- a/app_pojavlauncher/src/main/res/xml/pref_main.xml
+++ b/app_pojavlauncher/src/main/res/xml/pref_main.xml
@@ -24,10 +24,11 @@
android:key="flatButtonStyle"
android:summary="@string/mcl_setting_subtitle_flat_button_style"
android:title="@string/mcl_setting_title_flat_button_style"
- app2:icon="@drawable/hide_sidebar" />
+ app2:icon="@drawable/ic_flatstyle" />
@@ -53,11 +54,13 @@
app2:icon="@drawable/ignore_notch" />
@@ -71,6 +74,7 @@
android:title="@string/mcl_setting_title_javaargs" />
diff --git a/jre_lwjgl3glfw/src/main/java/org/lwjgl/opengl/Display.java b/jre_lwjgl3glfw/src/main/java/org/lwjgl/opengl/Display.java
index 448b9a8ac..26e26ccfa 100644
--- a/jre_lwjgl3glfw/src/main/java/org/lwjgl/opengl/Display.java
+++ b/jre_lwjgl3glfw/src/main/java/org/lwjgl/opengl/Display.java
@@ -61,7 +61,7 @@ public class Display {
private static boolean window_created;
/** The Drawable instance that tracks the current Display context */
- private static DrawableLWJGL drawable;
+ private static volatile DrawableLWJGL drawable;
private static Canvas parent;