2
0
Эх сурвалжийг харах

Disable touchpad touch events on OS X, as they lead to erroneous input.

Lasse Öörni 12 жил өмнө
parent
commit
5bf8f5d56d

+ 7 - 3
ThirdParty/SDL/src/video/cocoa/SDL_cocoawindow.m

@@ -18,6 +18,8 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+// Modified by Lasse Oorni for Urho3D
 #include "SDL_config.h"
 
 #if SDL_VIDEO_DRIVER_COCOA
@@ -484,16 +486,18 @@ static __inline__ void ConvertNSRect(NSRect *r)
         /* Make the origin the upper left instead of the lower left */
         y = 1.0f - y;
 
+        // Urho3D: disable touch events from the touchpad, as touch in Urho3D is understood
+        // to originate from absolute positioning devices like touch screens
         switch (type) {
         case COCOA_TOUCH_DOWN:
-            SDL_SendTouch(touchId, fingerId, SDL_TRUE, x, y, 1.0f);
+            //SDL_SendTouch(touchId, fingerId, SDL_TRUE, x, y, 1.0f);
             break;
         case COCOA_TOUCH_UP:
         case COCOA_TOUCH_CANCELLED:
-            SDL_SendTouch(touchId, fingerId, SDL_FALSE, x, y, 1.0f);
+            //SDL_SendTouch(touchId, fingerId, SDL_FALSE, x, y, 1.0f);
             break;
         case COCOA_TOUCH_MOVE:
-            SDL_SendTouchMotion(touchId, fingerId, x, y, 1.0f);
+            //SDL_SendTouchMotion(touchId, fingerId, x, y, 1.0f);
             break;
         }