mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-19 21:10:11 -07:00
Re-write the input pipe to C code
This commit is contained in:
parent
11f1e1b5c9
commit
904a8286dc
4 changed files with 260 additions and 24 deletions
|
|
@ -403,7 +403,7 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
|
|||
switch (e.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: // 0
|
||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||
CallbackBridge.sendGrabInitialPosUnset();
|
||||
CallbackBridge.sendPrepareGrabInitialPos();
|
||||
|
||||
isTouchInHotbar = hudKeyHandled != -1;
|
||||
if (isTouchInHotbar) {
|
||||
|
|
@ -631,7 +631,7 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
|
|||
switch (e.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: // 0
|
||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||
CallbackBridge.sendGrabInitialPosUnset();
|
||||
CallbackBridge.sendPrepareGrabInitialPos();
|
||||
|
||||
CallbackBridge.sendMouseKeycode(!CallbackBridge.mouseLeft ? LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT : LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT, 0, true);
|
||||
initialX = x;
|
||||
|
|
@ -693,6 +693,18 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
|
|||
}
|
||||
});
|
||||
minecraftGLView.setOnTouchListener(glTouchListener);
|
||||
minecraftGLView.setOnGenericMotionListener(new OnGenericMotionListener(){
|
||||
@Override
|
||||
public boolean onGenericMotion(View v, MotionEvent event) {
|
||||
switch (event.getActionMasked()) {
|
||||
case MotionEvent.ACTION_SCROLL:
|
||||
CallbackBridge.sendScroll((double) event.getAxisValue(MotionEvent.AXIS_VSCROLL), (double) event.getAxisValue(MotionEvent.AXIS_HSCROLL));
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
minecraftGLView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener(){
|
||||
|
||||
private boolean isCalled = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue