SDL: move mouse with right gamepad stick, added bounds checking to moving mouse with arrow keys

This commit is contained in:
pelya
2015-03-22 22:21:35 +02:00
parent f0688ea027
commit 546bbc3ea0
7 changed files with 102 additions and 55 deletions

View File

@@ -102,7 +102,7 @@ class Globals
public static int RightClickMethod = AppNeedsTwoButtonMouse ? Mouse.RIGHT_CLICK_WITH_MULTITOUCH : Mouse.RIGHT_CLICK_NONE;
public static int RightClickKey = KeyEvent.KEYCODE_MENU;
public static boolean MoveMouseWithJoystick = false;
public static int MoveMouseWithJoystickSpeed = 0;
public static int MoveMouseWithJoystickSpeed = 1;
public static int MoveMouseWithJoystickAccel = 0;
public static boolean MoveMouseWithGyroscope = false;
public static int MoveMouseWithGyroscopeSpeed = 2;

View File

@@ -411,7 +411,7 @@ abstract class DifferentTouchInput
DemoGLSurfaceView.nativeGamepadAnalogJoystickInput(
event.getAxisValue(MotionEvent.AXIS_X), event.getAxisValue(MotionEvent.AXIS_Y),
event.getAxisValue(MotionEvent.AXIS_Z), event.getAxisValue(MotionEvent.AXIS_RZ),
event.getAxisValue(MotionEvent.AXIS_RTRIGGER), event.getAxisValue(MotionEvent.AXIS_LTRIGGER),
event.getAxisValue(MotionEvent.AXIS_LTRIGGER), event.getAxisValue(MotionEvent.AXIS_RTRIGGER),
(hatX == 0.0f && hatY == 0.0f) ? 0 : 1 );
return;
}
@@ -1053,6 +1053,6 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL {
public static native void nativeHardwareMouseDetected( int detected );
public static native void nativeMouseButtonsPressed( int buttonId, int pressedState );
public static native void nativeMouseWheel( int scrollX, int scrollY );
public static native void nativeGamepadAnalogJoystickInput( float stick1x, float stick1y, float stick2x, float stick2y, float rtrigger, float ltrigger, int usingHat );
public static native void nativeGamepadAnalogJoystickInput( float stick1x, float stick1y, float stick2x, float stick2y, float ltrigger, float rtrigger, int usingHat );
public static native void nativeScreenVisibleRect( int x, int y, int w, int h );
}