Name
SDL_JoystickGetBall -- Get relative trackball motion
Synopsis
uses
SDL;
function SDL_JoystickGetBall( joystick : PSDL_Joystick; ball : var
Integer; dx : var Integer; dy : Integer) : Integer;
Description
Get the ball axis change.
Trackballs can only return relative motion since the last call to
SDL_JoystickGetBall, these motion deltas a placed into
dx and dy.
Return Value
Returns 0 on success or
-1 on failure
Examples
delta_x, delta_y : Integer;
joy : PSDL_Joystick;
.
.
.
SDL_JoystickUpdate;
if ( SDL_JoystickGetBall( joy, 0, delta_x, delta_y ) = -1) then
WriteLn( 'TrackBall Read Error!' );
WriteLn( Format('Trackball Delta- X:%d, Y:%d', [ delta_x, delta_y ] ) );