diff --git a/platform/android/android_input_handler.cpp b/platform/android/android_input_handler.cpp index d268867f5..ef3fd12d6 100644 --- a/platform/android/android_input_handler.cpp +++ b/platform/android/android_input_handler.cpp @@ -316,16 +316,6 @@ void AndroidInputHandler::process_double_tap(int event_android_button_mask, Poin input->parse_input_event(ev); } -void AndroidInputHandler::process_scroll(Point2 p_pos) { - Ref ev; - ev.instance(); - _set_key_modifier_state(ev); - ev->set_position(p_pos); - ev->set_delta(p_pos - scroll_prev_pos); - input->parse_input_event(ev); - scroll_prev_pos = p_pos; -} - int AndroidInputHandler::_button_index_from_mask(int button_mask) { switch (button_mask) { case BUTTON_MASK_LEFT: diff --git a/platform/android/android_input_handler.h b/platform/android/android_input_handler.h index cc28780e1..fba274b98 100644 --- a/platform/android/android_input_handler.h +++ b/platform/android/android_input_handler.h @@ -61,7 +61,6 @@ public: private: Vector touch; Point2 hover_prev_pos; // needed to calculate the relative position on hover events - Point2 scroll_prev_pos; // needed to calculate the relative position on scroll events bool alt_mem = false; bool shift_mem = false; @@ -88,7 +87,6 @@ public: void process_hover(int p_type, Point2 p_pos); void process_mouse_event(int event_action, int event_android_buttons_mask, Point2 event_pos, float event_vertical_factor, float event_horizontal_factor); void process_double_tap(int event_android_button_mask, Point2 p_pos); - void process_scroll(Point2 p_pos); void joy_connection_changed(int p_device, bool p_connected, String p_name); }; diff --git a/platform/android/java/lib/src/net/relintai/pandemonium/pandemonium/PandemoniumLib.java b/platform/android/java/lib/src/net/relintai/pandemonium/pandemonium/PandemoniumLib.java index 5c4ae4aef..a63890f94 100644 --- a/platform/android/java/lib/src/net/relintai/pandemonium/pandemonium/PandemoniumLib.java +++ b/platform/android/java/lib/src/net/relintai/pandemonium/pandemonium/PandemoniumLib.java @@ -104,11 +104,6 @@ public class PandemoniumLib { */ public static native void doubleTap(int buttonMask, int x, int y); - /** - * Forward scroll events from the main thread to the GL thread. - */ - public static native void scroll(int x, int y); - /** * Forward accelerometer sensor events from the main thread to the GL thread. * @see android.hardware.SensorEventListener#onSensorChanged(SensorEvent) diff --git a/platform/android/java/lib/src/net/relintai/pandemonium/pandemonium/input/PandemoniumGestureHandler.java b/platform/android/java/lib/src/net/relintai/pandemonium/pandemonium/input/PandemoniumGestureHandler.java index b6d8476d1..81c73309c 100644 --- a/platform/android/java/lib/src/net/relintai/pandemonium/pandemonium/input/PandemoniumGestureHandler.java +++ b/platform/android/java/lib/src/net/relintai/pandemonium/pandemonium/input/PandemoniumGestureHandler.java @@ -79,15 +79,6 @@ public class PandemoniumGestureHandler extends GestureDetector.SimpleOnGestureLi return true; } - @Override - public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { - //Log.i("PandemoniumGesture", "onScroll"); - final int x = Math.round(distanceX); - final int y = Math.round(distanceY); - PandemoniumLib.scroll(x, y); - return true; - } - @Override public boolean onFling(MotionEvent event1, MotionEvent event2, float velocityX, float velocityY) { //Log.i("PandemoniumGesture", "onFling"); diff --git a/platform/android/java_pandemonium_lib_jni.cpp b/platform/android/java_pandemonium_lib_jni.cpp index 1f2473bda..e9438c214 100644 --- a/platform/android/java_pandemonium_lib_jni.cpp +++ b/platform/android/java_pandemonium_lib_jni.cpp @@ -325,14 +325,6 @@ JNIEXPORT void JNICALL Java_net_relintai_pandemonium_pandemonium_PandemoniumLib_ input_handler->process_double_tap(p_button_mask, Point2(p_x, p_y)); } -// Called on the UI thread -JNIEXPORT void JNICALL Java_net_relintai_pandemonium_pandemonium_PandemoniumLib_scroll(JNIEnv *env, jclass clazz, jint p_x, jint p_y) { - if (step.get() <= 0) - return; - - input_handler->process_scroll(Point2(p_x, p_y)); -} - // Called on the UI thread JNIEXPORT void JNICALL Java_net_relintai_pandemonium_pandemonium_PandemoniumLib_joybutton(JNIEnv *env, jclass clazz, jint p_device, jint p_button, jboolean p_pressed) { if (step.get() <= 0) diff --git a/platform/android/java_pandemonium_lib_jni.h b/platform/android/java_pandemonium_lib_jni.h index bda0580de..73e49428c 100644 --- a/platform/android/java_pandemonium_lib_jni.h +++ b/platform/android/java_pandemonium_lib_jni.h @@ -49,7 +49,6 @@ JNIEXPORT void JNICALL Java_net_relintai_pandemonium_pandemonium_PandemoniumLib_ JNIEXPORT void JNICALL Java_net_relintai_pandemonium_pandemonium_PandemoniumLib_touch__IIII_3FIFF(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions, jint buttons_mask, jfloat vertical_factor, jfloat horizontal_factor); JNIEXPORT void JNICALL Java_net_relintai_pandemonium_pandemonium_PandemoniumLib_hover(JNIEnv *env, jclass clazz, jint p_type, jfloat p_x, jfloat p_y); JNIEXPORT void JNICALL Java_net_relintai_pandemonium_pandemonium_PandemoniumLib_doubleTap(JNIEnv *env, jclass clazz, jint p_button_mask, jint p_x, jint p_y); -JNIEXPORT void JNICALL Java_net_relintai_pandemonium_pandemonium_PandemoniumLib_scroll(JNIEnv *env, jclass clazz, jint p_x, jint p_y); JNIEXPORT void JNICALL Java_net_relintai_pandemonium_pandemonium_PandemoniumLib_key(JNIEnv *env, jclass clazz, jint p_keycode, jint p_scancode, jint p_unicode_char, jboolean p_pressed); JNIEXPORT void JNICALL Java_net_relintai_pandemonium_pandemonium_PandemoniumLib_joybutton(JNIEnv *env, jclass clazz, jint p_device, jint p_button, jboolean p_pressed); JNIEXPORT void JNICALL Java_net_relintai_pandemonium_pandemonium_PandemoniumLib_joyaxis(JNIEnv *env, jclass clazz, jint p_device, jint p_axis, jfloat p_value);