Skip to content

Commit

Permalink
prints
Browse files Browse the repository at this point in the history
  • Loading branch information
HEAVYPOLY committed Aug 29, 2024
1 parent c7adf75 commit 44c8e80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion platform/android/android_input_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ void AndroidInputHandler::_parse_mouse_event_info(int buttons_mask, bool p_press
if (!mouse_event_info.valid) {
return;
}
OS::get_singleton()->print("process_mouse_event info " );

Ref<InputEventMouseButton> ev;
ev.instance();
Expand Down Expand Up @@ -256,7 +257,6 @@ void AndroidInputHandler::_release_mouse_event_info(bool p_source_mouse_relative

void AndroidInputHandler::process_mouse_event(int p_event_action, int p_event_android_buttons_mask, Point2 p_event_pos, Vector2 p_delta, float p_pressure, Vector2 p_tilt, bool p_double_click, bool p_source_mouse_relative) {
int event_buttons_mask = _android_button_mask_to_godot_button_mask(p_event_android_buttons_mask);
OS::get_singleton()->print("Mouse event pressure: %f\n", p_pressure, p_tilt.x, p_tilt.y);

switch (p_event_action) {
case AMOTION_EVENT_ACTION_HOVER_MOVE: // hover move
Expand All @@ -283,6 +283,8 @@ void AndroidInputHandler::process_mouse_event(int p_event_action, int p_event_an

mouse_event_info.valid = true;
mouse_event_info.pos = p_event_pos;
OS::get_singleton()->print("Mouse down");

_parse_mouse_event_info(event_buttons_mask, true, false, p_double_click, p_source_mouse_relative);
} break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ private static boolean isMouseEvent(int eventSource) {
// System.out.println("ismouseevent eventsource == 20482");
mouseSource = true;
}
Log.d("Input", "is mouse event " + mouseSource + " " + eventSource);
return mouseSource;
}

Expand All @@ -466,7 +467,7 @@ static boolean handleMotionEvent(final MotionEvent event) {
return handleMouseEvent(event);
}

// System.out.println("handlemotionevent TOUCH");
Log.d("Input", "handleMotionEvent touch 1");
return handleTouchEvent(event);
}

Expand All @@ -491,7 +492,7 @@ static boolean handleMotionEvent(int eventSource, int eventAction, int buttonsMa
if (isMouseEvent(eventSource)) {
return handleMouseEvent(eventAction, buttonsMask, x, y, deltaX, deltaY, doubleTap, false, pressure, tiltX, tiltY);
}

Log.d("Input", "handleMotionEvent touch 2" + eventAction + " pressure " + pressure);
return handleTouchEvent(eventAction, x, y, doubleTap);
}
static boolean handleMouseEvent(final MotionEvent event) {
Expand All @@ -510,7 +511,7 @@ static boolean handleMouseEvent(final MotionEvent event) {
sourceMouseRelative = event.isFromSource(InputDevice.SOURCE_MOUSE_RELATIVE);
}
// Log the event details to the logcat instead of using System.out.println
Log.d("GodotInputHandler", "MotionEvent naked pressure " + pressure + " ACTION " + eventAction);
// Log.d("GodotInputHandler", "MotionEvent naked pressure " + pressure + " ACTION " + eventAction);

return handleMouseEvent(eventAction, buttonsMask, x, y, horizontalFactor, verticalFactor, false, sourceMouseRelative, pressure, orientation, tilt);
}
Expand All @@ -525,7 +526,10 @@ static boolean handleMouseEvent(int eventAction, int buttonsMask, float x, float
static boolean handleMouseEvent(int eventAction, int buttonsMask, float x, float y, boolean doubleClick) {
return handleMouseEvent(eventAction, buttonsMask, x, y, 0, 0, doubleClick, false, .9999f);
}


static boolean handleMouseEvent(int eventAction, int buttonsMask, float x, float y, float deltaX, float deltaY, boolean doubleClick, boolean sourceMouseRelative) {
return handleMouseEvent(eventAction, buttonsMask, x, y, deltaX, deltaY, doubleClick, sourceMouseRelative, .9999f);
}

static boolean handleMouseEvent(int eventAction, int buttonsMask, float x, float y, float deltaX, float deltaY, boolean doubleClick, boolean sourceMouseRelative, float pressure) {
// We don't handle ACTION_BUTTON_PRESS and ACTION_BUTTON_RELEASE events as they typically
Expand Down

0 comments on commit 44c8e80

Please sign in to comment.