equal
deleted
inserted
replaced
26 event.tfinger.pressure - the pressure of the touch (0..1) |
26 event.tfinger.pressure - the pressure of the touch (0..1) |
27 |
27 |
28 SDL_FINGERMOTION: |
28 SDL_FINGERMOTION: |
29 Sent when a finger (or stylus) is moved on the touch device. |
29 Sent when a finger (or stylus) is moved on the touch device. |
30 Fields: |
30 Fields: |
31 Same as FINGERDOWN but with additional: |
31 Same as SDL_FINGERDOWN but with additional: |
32 event.tfinger.dx - change in x coordinate during this motion event. |
32 event.tfinger.dx - change in x coordinate during this motion event. |
33 event.tfinger.dy - change in y coordinate during this motion event. |
33 event.tfinger.dy - change in y coordinate during this motion event. |
34 |
34 |
35 SDL_FINGERUP: |
35 SDL_FINGERUP: |
36 Sent when a finger (or stylus) is lifted from the touch device. |
36 Sent when a finger (or stylus) is lifted from the touch device. |
37 Fields: |
37 Fields: |
38 Same as FINGERDOWN. |
38 Same as SDL_FINGERDOWN. |
39 |
39 |
40 |
40 |
41 =========================================================================== |
41 =========================================================================== |
42 Functions |
42 Functions |
43 =========================================================================== |
43 =========================================================================== |
50 This returns a SDL_TouchID. |
50 This returns a SDL_TouchID. |
51 IMPORTANT: If the touch has been removed, or there is no touch with the given ID, SDL_GetTouchID will return 0. Be sure to check for this! |
51 IMPORTANT: If the touch has been removed, or there is no touch with the given ID, SDL_GetTouchID will return 0. Be sure to check for this! |
52 |
52 |
53 The number of touch devices can be queried with SDL_GetNumTouchDevices(). |
53 The number of touch devices can be queried with SDL_GetNumTouchDevices(). |
54 |
54 |
55 A SDL_Touch may be used to get pointers to SDL_Finger. |
55 A SDL_TouchID may be used to get pointers to SDL_Finger. |
56 |
56 |
57 SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device. |
57 SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device. |
58 |
58 |
59 The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following: |
59 The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following: |
60 |
60 |
63 |
63 |
64 |
64 |
65 |
65 |
66 To get a SDL_Finger, call SDL_GetTouchFinger(touchID,index), where touchID is a SDL_TouchID, and index is the requested finger. |
66 To get a SDL_Finger, call SDL_GetTouchFinger(touchID,index), where touchID is a SDL_TouchID, and index is the requested finger. |
67 This returns a SDL_Finger*, or NULL if the finger does not exist, or has been removed. |
67 This returns a SDL_Finger*, or NULL if the finger does not exist, or has been removed. |
68 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 FINGERUP event is polled. |
68 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 As a result, be very careful to check for NULL return values. |
69 As a result, be very careful to check for NULL return values. |
70 |
70 |
71 A SDL_Finger has the following fields: |
71 A SDL_Finger has the following fields: |
72 >x,y,pressure: |
72 >x,y,pressure: |
73 The current coordinates of the touch. |
73 The current coordinates of the touch. |