@@ -29,6 +29,8 @@ public InGUIEventProcessor(float scaleFactor) {
2929
3030 @ Override
3131 public boolean processTouchEvent (MotionEvent motionEvent ) {
32+ boolean singleTap = mSingleTapDetector .onTouchEvent (motionEvent );
33+
3234 switch (motionEvent .getActionMasked ()) {
3335 case MotionEvent .ACTION_DOWN :
3436 mTracker .startTracking (motionEvent );
@@ -66,13 +68,17 @@ public boolean processTouchEvent(MotionEvent motionEvent) {
6668 case MotionEvent .ACTION_UP :
6769 mScroller .resetScrollOvershoot ();
6870 mTracker .cancelTracking ();
71+
72+ // Handle single tap on gestures
73+ if ((!LauncherPreferences .PREF_DISABLE_GESTURES || touchpadDisplayed ()) && !mIsMouseDown && singleTap ) {
74+ CallbackBridge .putMouseEventWithCoords (LwjglGlfwKeycode .GLFW_MOUSE_BUTTON_LEFT , CallbackBridge .mouseX , CallbackBridge .mouseY );
75+ }
76+
6977 if (mIsMouseDown ) disableMouse ();
7078 resetGesture ();
7179 }
7280
73- if ((!LauncherPreferences .PREF_DISABLE_GESTURES || touchpadDisplayed ()) && mSingleTapDetector .onTouchEvent (motionEvent )) {
74- clickMouse ();
75- }
81+
7682 return true ;
7783 }
7884
@@ -98,14 +104,9 @@ private void disableMouse() {
98104 mIsMouseDown = false ;
99105 }
100106
101- private void clickMouse () {
102- CallbackBridge .sendMouseButton (LwjglGlfwKeycode .GLFW_MOUSE_BUTTON_LEFT , true );
103- CallbackBridge .sendMouseButton (LwjglGlfwKeycode .GLFW_MOUSE_BUTTON_LEFT , false );
104- }
105-
106107 private void setGestureStart (MotionEvent event ) {
107- mStartX = event .getX ();
108- mStartY = event .getY ();
108+ mStartX = event .getX () * mScaleFactor ;
109+ mStartY = event .getY () * mScaleFactor ;
109110 }
110111
111112 private void resetGesture () {
0 commit comments