mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 07:05:40 -04:00
fix(gesture): Right click not working
Turns out if you were perfectly still, it would fail. For a quick tap, it was fairly easy to create.
This commit is contained in:
parent
2e596cd07f
commit
a72451c9e7
@ -17,14 +17,15 @@ public class RightClickGesture extends ValidatorGesture {
|
||||
public final void inputEvent() {
|
||||
if(!mGestureEnabled) return;
|
||||
if(submit()) {
|
||||
mGestureStartX = CallbackBridge.mouseX;
|
||||
mGestureStartY = CallbackBridge.mouseY;
|
||||
mGestureStartX = mGestureEndX = CallbackBridge.mouseX;
|
||||
mGestureStartY = mGestureEndY = CallbackBridge.mouseY;
|
||||
mGestureEnabled = false;
|
||||
mGestureValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMotion(float deltaX, float deltaY) {
|
||||
System.out.println("set motion called");
|
||||
mGestureEndX += deltaX;
|
||||
mGestureEndY += deltaY;
|
||||
}
|
||||
@ -49,6 +50,7 @@ public class RightClickGesture extends ValidatorGesture {
|
||||
mGestureEnabled = true;
|
||||
if(!mGestureValid || isSwitching) return;
|
||||
boolean fingerStill = LeftClickGesture.isFingerStill(mGestureStartX, mGestureStartY, mGestureEndX, mGestureEndY, LeftClickGesture.FINGER_STILL_THRESHOLD);
|
||||
System.out.println("Right click: " + fingerStill);
|
||||
if(!fingerStill) return;
|
||||
CallbackBridge.sendMouseButton(LwjglGlfwKeycode.GLFW_MOUSE_BUTTON_RIGHT, true);
|
||||
CallbackBridge.sendMouseButton(LwjglGlfwKeycode.GLFW_MOUSE_BUTTON_RIGHT, false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user