diff src/events/SDL_touch.c @ 4654:7dbcd71216df

Added $1 gesture recognition. Functional.
author Jim Grandpre <jim.tla@gmail.com>
date Thu, 17 Jun 2010 03:41:27 -0400
parents 0350b634c044
children 4c94f2023d62
line wrap: on
line diff
--- a/src/events/SDL_touch.c	Tue Jun 15 02:12:16 2010 -0400
+++ b/src/events/SDL_touch.c	Thu Jun 17 03:41:27 2010 -0400
@@ -322,7 +322,7 @@
 	nf.last_y = y;
 	nf.last_pressure = pressure;
 	SDL_AddFinger(touch,&nf);
-
+	//if(x < 0 || y < 0) return 0; //should defer if only a partial input
 	posted = 0;
 	if (SDL_GetEventState(SDL_FINGERDOWN) == SDL_ENABLE) {
 	    SDL_Event event;
@@ -364,15 +364,14 @@
     int xrel;
     int yrel;
     int x_max = 0, y_max = 0;
-
+	
     if (!touch || touch->flush_motion) {
-        return 0;
+		return 0;
     }
-
-	if(finger == NULL) {
-		SDL_SendFingerDown(id,fingerid,SDL_TRUE,x,y,pressure);
-		return 0;
-	} else {
+    
+    if(finger == NULL) {
+		return SDL_SendFingerDown(id,fingerid,SDL_TRUE,x,y,pressure);	
+    } else {
 		/* the relative motion is calculated regarding the last position */
 		if (relative) {
 			xrel = x;
@@ -389,9 +388,9 @@
 		
 		/* Drop events that don't change state */
 		if (!xrel && !yrel) {
-	#if 0
+#if 0
 			printf("Touch event didn't change state - dropped!\n");
-	#endif
+#endif
 			return 0;
 		}