Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Thursday, June 13, 2019
 
 

SDL_JoystickGetBall (3)

Name

SDL_JoystickGetBall - Get relative trackball motion

Synopsis

#include "SDL.h"

int  SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int
*dy);

Description

SDL_JoystickGetBall(3)         SDL API Reference        SDL_JoystickGetBall(3)



NAME
       SDL_JoystickGetBall - Get relative trackball motion

SYNOPSIS
       #include "SDL.h"

       int  SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int
       *dy);

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
       int delta_x, delta_y;
       SDL_Joystick *joy;
       .
       .
       .
       SDL_JoystickUpdate();
       if(SDL_JoystickGetBall(joy, 0, &delta_x, &delta_y)==-1)
         printf("TrackBall Read Error!
       ");
       printf("Trackball Delta- X:%d, Y:%d
       ", delta_x, delta_y);

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+------------------+
       |ATTRIBUTE TYPE | ATTRIBUTE VALUE  |
       +---------------+------------------+
       |Availability   | library/sdl      |
       +---------------+------------------+
       |Stability      | Volatile         |
       +---------------+------------------+
SEE ALSO
       SDL_JoystickNumBalls



NOTES
       This     software     was    built    from    source    available    at
       https://github.com/oracle/solaris-userland.   The  original   community
       source        was        downloaded        from        https://www.lib-
       sdl.org/release/SDL-1.2.15.tar.gz

       Further information about this software can be found on the open source
       community website at https://www.libsdl.org/.



SDL                         Tue 11 Sep 2001, 23:00      SDL_JoystickGetBall(3)