docs/README-touch.md
changeset 9066 c2af3ff967cc
parent 9025 d09d4b578e77
child 10212 af95dd343a25
equal deleted inserted replaced
9065:c8a8b11fd0ad 9066:c2af3ff967cc
    18 Events
    18 Events
    19 ===========================================================================
    19 ===========================================================================
    20 SDL_FINGERDOWN:
    20 SDL_FINGERDOWN:
    21 Sent when a finger (or stylus) is placed on a touch device.
    21 Sent when a finger (or stylus) is placed on a touch device.
    22 Fields:
    22 Fields:
    23 event.tfinger.touchId  - the Id of the touch device.
    23 * event.tfinger.touchId  - the Id of the touch device.
    24 event.tfinger.fingerId - the Id of the finger which just went down.
    24 * event.tfinger.fingerId - the Id of the finger which just went down.
    25 event.tfinger.x        - the x coordinate of the touch (0..1)
    25 * event.tfinger.x        - the x coordinate of the touch (0..1)
    26 event.tfinger.y        - the y coordinate of the touch (0..1)
    26 * event.tfinger.y        - the y coordinate of the touch (0..1)
    27 event.tfinger.pressure - the pressure of the touch (0..1)
    27 * event.tfinger.pressure - the pressure of the touch (0..1)
    28 
    28 
    29 SDL_FINGERMOTION:
    29 SDL_FINGERMOTION:
    30 Sent when a finger (or stylus) is moved on the touch device.
    30 Sent when a finger (or stylus) is moved on the touch device.
    31 Fields:
    31 Fields:
    32 Same as SDL_FINGERDOWN but with additional:
    32 Same as SDL_FINGERDOWN but with additional:
    33 event.tfinger.dx       - change in x coordinate during this motion event.
    33 * event.tfinger.dx       - change in x coordinate during this motion event.
    34 event.tfinger.dy       - change in y coordinate during this motion event.
    34 * event.tfinger.dy       - change in y coordinate during this motion event.
    35 
    35 
    36 SDL_FINGERUP:
    36 SDL_FINGERUP:
    37 Sent when a finger (or stylus) is lifted from the touch device.
    37 Sent when a finger (or stylus) is lifted from the touch device.
    38 Fields:
    38 Fields:
    39 Same as SDL_FINGERDOWN.
    39 Same as SDL_FINGERDOWN.
    68 This returns a SDL_Finger*, or NULL if the finger does not exist, or has been removed.
    68 This returns a SDL_Finger*, or NULL if the finger does not exist, or has been removed.
    69 A 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 SDL_FINGERUP event is polled.
    69 A 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 SDL_FINGERUP event is polled.
    70 As a result, be very careful to check for NULL return values.
    70 As a result, be very careful to check for NULL return values.
    71 
    71 
    72 A SDL_Finger has the following fields:
    72 A SDL_Finger has the following fields:
    73 >x,y,pressure:
    73 * x,y,pressure:
    74 	The current coordinates of the touch.
    74 	The current coordinates of the touch.
    75 >pressure:
    75 * pressure:
    76 	The pressure of the touch.
    76 	The pressure of the touch.
       
    77 
    77 
    78 
    78 ===========================================================================
    79 ===========================================================================
    79 Notes
    80 Notes
    80 ===========================================================================
    81 ===========================================================================
    81 For a complete example see test/testgesture.c
    82 For a complete example see test/testgesture.c