NAME
SDL2::touch - SDL Touch Event Handling
SYNOPSIS
use SDL2 qw[:touch];
DESCRIPTION
SDL2::touch provides functions and defined values that allow for handling simple touch events. These functions may be imported by name or with the :touch
tag.
Functions
These may be imported by name or with the :touch
tag.
SDL_GetNumTouchDevices( )
Get the number of registered touch devices.
On some platforms SDL first sees the touch device if it was actually used. Therefore SDL_GetNumTouchDevices( )
may return 0
although devices are available. After using all devices at least once the number will be correct.
Returns the number of registered touch devices.
SDL_GetTouchDevice( ... )
Get the touch ID with the given index.
Expected parameters include:
Returns the touch ID with the given index on success or 0
if the index is invalid; call SDL_GetError( )
for more information.
SDL_GetTouchDeviceType( ... )
Get the type of the given touch device.
Expected parameters include:
Returns a SDL_TouchDeviceType
.
SDL_GetNumTouchFingers( ... )
Get the number of active fingers for a given touch device.
Expected parameters include:
Returns the number of active fingers for a given touch device on success or 0
on failure; call SDL_GetError( )
for more information.
SDL_GetTouchFinger( ... )
Get the finger object for specified touch device ID and finger index.
The returned resource is owned by SDL and should not be deallocated.
Expected parameters include:
Returns a pointer to the SDL2::Finger object or undef
if no object at the given ID and index could be found.
Defined Types, Enumerations, and Values
These values may be imported by name or with the given tag.
SDL_TouchID
Signed 64-bit integer.
SDL_FingerID
Signed 64-bit integer.
SDL_TouchDeviceType
Enumeration which may be imported with the :touchDeviceType
tag.
SDL_TOUCH_DEVICE_INVALID
SDL_TOUCH_DEVICE_DIRECT
- touch screen with window-relative coordinatesSDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE
- trackpad with absolute device coordinatesSDL_TOUCH_DEVICE_INDIRECT_RELATIVE
- trackpad with screen cursor-relative coordinates
SDL_TOUCH_MOUSEID
Used as the device ID for mouse events simulated with touch input.
SDL_MOUSE_TOUCHID
Used as the SDL_TouchID
for touch events simulated with mouse input.
LICENSE
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module.
AUTHOR
Sanko Robinson <sanko@cpan.org>