Skip to content

Commit

Permalink
erf
Browse files Browse the repository at this point in the history
  • Loading branch information
HEAVYPOLY committed Aug 29, 2024
1 parent 6e35afc commit 8869f1e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,17 @@ internal class GodotGestureHandler : SimpleOnGestureListener(), OnScaleGestureLi
if (contextClickInProgress || GodotInputHandler.isMouseEvent(event)) {
// This may be an ACTION_BUTTON_RELEASE event which we don't handle,
// so we convert it to an ACTION_UP event.
GodotInputHandler.handleMouseEvent(
MotionEvent.ACTION_UP,
event.buttonState,
event.x,
event.y,
0f,
0f,
false,
sourceMouseRelative
)
GodotInputHandler.handleMouseEvent(event)
// GodotInputHandler.handleMouseEvent(
// MotionEvent.ACTION_UP,
// event.buttonState,
// event.x,
// event.y,
// 0f,
// 0f,
// false,
// sourceMouseRelative
// )
} else {
GodotInputHandler.handleTouchEvent(event)
}
Expand All @@ -178,16 +179,18 @@ internal class GodotGestureHandler : SimpleOnGestureListener(), OnScaleGestureLi
} else {
false
}
GodotInputHandler.handleMouseEvent(
event.actionMasked,
MotionEvent.BUTTON_SECONDARY,
event.x,
event.y,
0f,
0f,
false,
sourceMouseRelative
)
GodotInputHandler.handleMouseEvent(event)

// GodotInputHandler.handleMouseEvent(
// event.actionMasked,
// MotionEvent.BUTTON_SECONDARY,
// event.x,
// event.y,
// 0f,
// 0f,
// false,
// sourceMouseRelative,
// )
return true
}
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ private static boolean isMouseEvent(int eventSource) {
}

static boolean handleMotionEvent(final MotionEvent event) {
Log.d("GodotInputHandler", "handleMotionEvent " + event.getPressure());
if (isMouseEvent(event)) {
return handleMouseEvent(event);
}
Expand Down Expand Up @@ -486,12 +487,12 @@ static boolean handleMouseEvent(final MotionEvent event) {
final int eventAction = event.getActionMasked();
final float x = event.getX();
final float y = event.getY();
final float pressure = event.getPressure();
final float tilt = event.getAxisValue(MotionEvent.AXIS_TILT);
final float orientation = event.getOrientation();
final int buttonsMask = event.getButtonState();
float tiltX = 0;
float tiltY = 0;
float pressure = 0f;
float tiltX = 0f;
float tiltY = 0f;
float verticalFactor = 0;
float horizontalFactor = 0;

Expand All @@ -512,9 +513,9 @@ static boolean handleMouseEvent(final MotionEvent event) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
sourceMouseRelative = event.isFromSource(InputDevice.SOURCE_MOUSE_RELATIVE);
}

Log.d("GodotInputHandler", "handleMouseEvent " + horizontalFactor + " " + verticalFactor + " ACTION " + eventAction + " buttonMask " + buttonsMask);
return handleMouseEvent(eventAction, buttonsMask, x, y, horizontalFactor, verticalFactor, false, sourceMouseRelative, pressure, orientation, tilt);
pressure = event.getPressure();
Log.d("GodotInputHandler", "handleMouseEvent " + eventAction + " buttonMask " + buttonsMask + " pressure " + pressure + " tilt " + tiltX);
return handleMouseEvent(eventAction, buttonsMask, x, y, horizontalFactor, verticalFactor, false, sourceMouseRelative, pressure, tiltX, tiltY);

}
static boolean handleMouseEvent(int eventAction, int buttonsMask, float x, float y, float deltaX, float deltaY, boolean doubleClick, boolean sourceMouseRelative) {
Expand Down

0 comments on commit 8869f1e

Please sign in to comment.