mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-09 16:45:37 -07:00
Release 2.2
This commit is contained in:
parent
668660e13e
commit
5330ad05ef
3 changed files with 7 additions and 30 deletions
Binary file not shown.
|
|
@ -220,30 +220,14 @@ public class GLFWGLSurface extends View implements GrabListener {
|
||||||
public void onSurfaceTextureUpdated(@NonNull SurfaceTexture surface) {}
|
public void onSurfaceTextureUpdated(@NonNull SurfaceTexture surface) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.longPressDetector = new GestureDetector(getContext(), new GestureDetector.SimpleOnGestureListener() {
|
longPressDetector = new GestureDetector(getContext(), new GestureDetector.SimpleOnGestureListener() {
|
||||||
|
|
||||||
boolean isDragClicking = false;
|
|
||||||
@Override
|
@Override
|
||||||
public void onLongPress(MotionEvent e) {
|
public void onLongPress(MotionEvent e) {
|
||||||
super.onLongPress(e);
|
super.onLongPress(e);
|
||||||
if(!isDragClicking) {
|
CallbackBridge.putMouseEventWithCoords(LwjglGlfwKeycode.GLFW_MOUSE_BUTTON_RIGHT, CallbackBridge.mouseX, CallbackBridge.mouseY);
|
||||||
isDragClicking = true;
|
|
||||||
AWTInputBridge.sendKey((char) AWTInputEvent.VK_F5, AWTInputEvent.VK_F5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onSingleTapUp(MotionEvent e) {
|
|
||||||
if(isDragClicking) {
|
|
||||||
isDragClicking = false;
|
|
||||||
AWTInputBridge.sendKey((char)AWTInputEvent.VK_F5, AWTInputEvent.VK_F5);
|
|
||||||
}
|
|
||||||
return super.onSingleTapUp(e);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//this.longPressDetector.setIsLongpressEnabled(true);
|
|
||||||
|
|
||||||
((ViewGroup)getParent()).addView(textureView);
|
((ViewGroup)getParent()).addView(textureView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -257,7 +241,7 @@ public class GLFWGLSurface extends View implements GrabListener {
|
||||||
@SuppressWarnings("accessibility")
|
@SuppressWarnings("accessibility")
|
||||||
public boolean onTouchEvent(MotionEvent e) {
|
public boolean onTouchEvent(MotionEvent e) {
|
||||||
scaleGestureDetector.onTouchEvent(e);
|
scaleGestureDetector.onTouchEvent(e);
|
||||||
//longPressDetector.onTouchEvent(e);
|
longPressDetector.onTouchEvent(e);
|
||||||
// Kinda need to send this back to the layout
|
// Kinda need to send this back to the layout
|
||||||
if(((ControlLayout)getParent()).getModifiable()) return false;
|
if(((ControlLayout)getParent()).getModifiable()) return false;
|
||||||
|
|
||||||
|
|
@ -280,7 +264,6 @@ public class GLFWGLSurface extends View implements GrabListener {
|
||||||
CallbackBridge.mouseY = (e.getY() * mScaleFactor);
|
CallbackBridge.mouseY = (e.getY() * mScaleFactor);
|
||||||
//One android click = one MC click
|
//One android click = one MC click
|
||||||
if(mSingleTapDetector.onTouchEvent(e)){ //
|
if(mSingleTapDetector.onTouchEvent(e)){ //
|
||||||
//longPressDetector.onTouchEvent(e);// Touch Mode
|
|
||||||
CallbackBridge.putMouseEventWithCoords(LwjglGlfwKeycode.GLFW_MOUSE_BUTTON_LEFT, CallbackBridge.mouseX, CallbackBridge.mouseY);
|
CallbackBridge.putMouseEventWithCoords(LwjglGlfwKeycode.GLFW_MOUSE_BUTTON_LEFT, CallbackBridge.mouseX, CallbackBridge.mouseY);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -429,6 +412,7 @@ public class GLFWGLSurface extends View implements GrabListener {
|
||||||
|
|
||||||
// Actualise the pointer count
|
// Actualise the pointer count
|
||||||
mLastPointerCount = e.getPointerCount();
|
mLastPointerCount = e.getPointerCount();
|
||||||
|
longPressDetector.onTouchEvent(e);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
private TouchCharInput mTouchCharInput;
|
private TouchCharInput mTouchCharInput;
|
||||||
|
|
||||||
private LinearLayout mTouchPad;
|
private LinearLayout mTouchPad;
|
||||||
boolean isDragClicking = false;
|
|
||||||
private ImageView mMousePointerImageView;
|
private ImageView mMousePointerImageView;
|
||||||
private GestureDetector mGestureDetector;
|
private GestureDetector mGestureDetector;
|
||||||
|
|
||||||
|
|
@ -187,20 +186,14 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
longPressDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {
|
longPressDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onLongPress(MotionEvent e) {
|
public void onLongPress(MotionEvent e) {
|
||||||
|
// Send RightClick
|
||||||
|
AWTInputBridge.sendKey((char)AWTInputEvent.VK_F11,AWTInputEvent.VK_F11);
|
||||||
|
AWTInputBridge.sendMousePress(AWTInputEvent.BUTTON1_DOWN_MASK);
|
||||||
super.onLongPress(e);
|
super.onLongPress(e);
|
||||||
Log.i("downthecrop","Hi from a long press!");
|
|
||||||
if(!isDragClicking) {
|
|
||||||
isDragClicking = true;
|
|
||||||
//AWTInputBridge.sendKey((char) AWTInputEvent.VK_F5, AWTInputEvent.VK_F5);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onSingleTapUp(MotionEvent e) {
|
public boolean onSingleTapUp(MotionEvent e) {
|
||||||
if(isDragClicking) {
|
|
||||||
isDragClicking = false;
|
|
||||||
//AWTInputBridge.sendKey((char)AWTInputEvent.VK_F5, AWTInputEvent.VK_F5);
|
|
||||||
}
|
|
||||||
return super.onSingleTapUp(e);
|
return super.onSingleTapUp(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue