[SDL] SDL_TouchFingerEvent (SDL2)

Sam Lantinga slouken at libsdl.org
Mon Mar 25 10:01:13 PDT 2013


The touch coordinates are in the 0...1 range in the horizontal and vertical
axes across the touch device.  This typically means across the entire
screen in global coordinates.

On Mon, Mar 25, 2013 at 3:20 AM, Pavel Kanzelsberger <kanzels at gmail.com>wrote:

> Yes that that is the exact reason. And it was there before, no idea why it
> was removed.
>
> Now the coordinates of such event are in global coordinates or some window
> local coordinates? What window did they occur in?
>
> This is not a problem on a mobile device, since there's only one window,
> but on other operating systems where touch is supported this should report
> a window...
>
> Pavel
>
> On 24.3.2013, at 1:11, Sik the hedgehog <sik.the.hedgehog at gmail.com>
> wrote:
>
> > 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
> >>>
> >>
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130325/9c4f17ca/attachment-0009.htm>


More information about the SDL mailing list