Updated README's
authorJim Grandpre <jim.tla@gmail.com>
Thu, 19 Aug 2010 13:47:12 -0400
changeset 4690baf8195aeb92
parent 4689 f9ab8df6d45a
child 4691 73f5c530afac
Updated README's
README.gesture
README.touch
     1.1 --- a/README.gesture	Sun Aug 15 00:36:28 2010 -0400
     1.2 +++ b/README.gesture	Thu Aug 19 13:47:12 2010 -0400
     1.3 @@ -5,7 +5,7 @@
     1.4  
     1.5  Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up. 
     1.6  
     1.7 -Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this simply re-recording on of the gestures should result in a different ID.
     1.8 +Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID.
     1.9  
    1.10  Recording:
    1.11  ----------
    1.12 @@ -19,7 +19,6 @@
    1.13  event.dgesture.gestureId - the unique id of the recoreded gesture.
    1.14  
    1.15  
    1.16 -
    1.17  Performing:
    1.18  -----------
    1.19  As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields:
    1.20 @@ -53,7 +52,7 @@
    1.21  ===========================================================================
    1.22  Multi Gestures
    1.23  ===========================================================================
    1.24 -SDL provides simple support to pinch/rotate/swipe gestures. 
    1.25 +SDL provides simple support for pinch/rotate/swipe gestures. 
    1.26  Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields:
    1.27  
    1.28  event.mgesture.touchId - the Id of the touch on which the gesture was performed.
     2.1 --- a/README.touch	Sun Aug 15 00:36:28 2010 -0400
     2.2 +++ b/README.touch	Thu Aug 19 13:47:12 2010 -0400
     2.3 @@ -1,3 +1,18 @@
     2.4 +===========================================================================
     2.5 +System Specific Notes
     2.6 +===========================================================================
     2.7 +Linux:
     2.8 +The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it.
     2.9 +
    2.10 +Mac: 
    2.11 +The Mac and Iphone API's are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do.
    2.12 +
    2.13 +iPhone: 
    2.14 +Works out of box.
    2.15 +
    2.16 +Winows:
    2.17 +Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com
    2.18 +
    2.19  ===========================================================================
    2.20  Events
    2.21  ===========================================================================
    2.22 @@ -14,8 +29,8 @@
    2.23  Sent when a finger (or stylus) is moved on the touch device.
    2.24  Fields:
    2.25  Same as FINGERDOWN but with additional:
    2.26 -event.tfginer.dx       - chagne in x coordinate during this motion event.
    2.27 -event.tfginer.dy       - chagne in y coordinate during this motion event.
    2.28 +event.tfginer.dx       - change in x coordinate during this motion event.
    2.29 +event.tfginer.dy       - change in y coordinate during this motion event.
    2.30  
    2.31  SDL_FINGERMOTION:
    2.32  Sent when a finger (or stylus) is lifted from the touch device.
    2.33 @@ -36,13 +51,13 @@
    2.34  IMPORTANT: If the touch has been removed, or there is no touch with the given ID, SDL_GetTouch will return null. Be sure to check for this!
    2.35  
    2.36  An SDL_Touch has the following fields:
    2.37 +>xres,yres,pressures:
    2.38 +	The resolution at which x,y, and pressure values are reported. Currently these will always be equal to 2^15, but this may not always be the case. 
    2.39 +
    2.40  >pressure_max, pressure_min, x_max, x_min, y_max, y_min
    2.41  	Which give, respectively, the maximum and minumum values that the touch digitizer can return for pressure, x coordiniate, and y coordinate AS REPORTED BY THE OPERATING SYSTEM.
    2.42  On Mac/iPhone systems _max will always be 0, and _min will always be 1. 
    2.43  
    2.44 ->xres,yres,pressures:
    2.45 -	The resolution at which x,y, and pressure values are reported. Currently these will always be equal to 2^15, but this may not always be the case. 
    2.46 -
    2.47  >native_xres,native_yres,native_pressureres:
    2.48  	The native resolution of the touch device AS REPORTED BY THE OPERATING SYSTEM.
    2.49  On Mac/iPhone systems these will always be 1.
    2.50 @@ -54,18 +69,19 @@
    2.51  	An array of pointers to the fingers which are on the device.
    2.52  
    2.53  
    2.54 -The most common reason to get a touch device is to normalize inputs. This would look something like:
    2.55 +The most common reason to access a touch device is to normalize inputs. This would be accomplished by code like the following:
    2.56  
    2.57        SDL_Touch* inTouch = SDL_GetTouch(event.tfinger.touchId);
    2.58 -      if(inTouch == NULL) continue;
    2.59 +      if(inTouch == NULL) continue; //The touch has been removed
    2.60  
    2.61        float x = ((float)event.tfinger.x)/inTouch->xres;
    2.62 -      float y = ((float)event.tfinger.y)/inTouch->yres;      
    2.63 +      float y = ((float)event.tfinger.y)/inTouch->yres;
    2.64 +
    2.65  
    2.66  
    2.67  To get an SDL_Finger, call SDL_GetFinger(touch,fingerId), where touch is a pointer to an SDL_Touch device, and fingerId is the id of the requested finger.
    2.68  This returns an SDL_Finger*, or null if the finger does not exist, or has been removed.
    2.69 -An SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus BEFORE the FINGERUP event is seen. 
    2.70 +An SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the FINGERUP event is polled. 
    2.71  As a result, be very careful to check for null return values.
    2.72  
    2.73  An SDL_Finger has the following fields:
    2.74 @@ -74,4 +90,12 @@
    2.75  >xdelta,ydelta: 
    2.76  	The change in position resulting from the last finger motion.
    2.77  >last_x, last_y, last_pressure:
    2.78 -	 The previous coordinates of the touch.
    2.79 \ No newline at end of file
    2.80 +	 The previous coordinates of the touch.
    2.81 +
    2.82 +===========================================================================
    2.83 +Notes
    2.84 +===========================================================================
    2.85 +For a complete example see test/testgesture.c
    2.86 +
    2.87 +Please direct questions/comments to:
    2.88 +   jim.tla+sdl_touch@gmail.com
    2.89 \ No newline at end of file