[SDL] SDL_TouchFingerEvent (SDL2)

Sik the hedgehog sik.the.hedgehog at gmail.com
Sat Mar 23 17:11:03 PDT 2013


I think he may want to know on what window the touch events happen
(e.g. on which window the fingers started the gesture). This would
matter if you have multiple windows opened.

2013/3/23, Sam Lantinga <slouken at libsdl.org>:
> Touch events are not associated with a window, they are associated with a
> touch device.
>
> On Sat, Mar 23, 2013 at 12:46 PM, Pavel Kanzelsberger
> <kanzels at gmail.com>wrote:
>
>> Hello guys,
>>
>> I pulled the latest version of SDL 2 and my programs won't compile, since
>> there's now windowID removed from this structure:
>>
>> /**
>>  *  \brief Touch finger event structure (event.tfinger.*)
>>  */
>> typedef struct SDL_TouchFingerEvent
>> {
>>     Uint32 type;        /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or
>> ::SDL_FINGERUP */
>>     Uint32 timestamp;
>>     SDL_TouchID touchId; /**< The touch device id */
>>     SDL_FingerID fingerId;
>>     float x;            /**< Normalized in the range 0...1 */
>>     float y;            /**< Normalized in the range 0...1 */
>>     float dx;           /**< Normalized in the range 0...1 */
>>     float dy;           /**< Normalized in the range 0...1 */
>>     float pressure;     /**< Normalized in the range 0...1 */
>> } SDL_TouchFingerEvent;
>>
>> However it is present in all other events that has something to do with a
>> window. Now how do I know in what window this touch event happened??? On
>> iOS this is simple, since there's only one window, but I thought it will
>> work on OS X for example too. And there you can have multiple windows.
>>
>> regards,
>> Pavel Kanzelsberger
>> _______________________________________________
>> SDL mailing list
>> SDL at lists.libsdl.org
>> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>>
>



More information about the SDL mailing list