Name
sdl.GetBall -- query state of specified ball
Synopsis
dx, dy = sdl.GetBall(port, ball)
Function
Use this function to get the ball axis change since the last poll. This is only possible for joysticks, not for game controllers.

You have to pass the ball index to query in ball. Ball indices start at index 0. sdl.GetBall() will return the difference in the x and y axis position since the last poll. Note that since trackballs can only return relative motion these return values are delta values.

Inputs
port
game port to query
ball
ball index to query
Results
dx
the difference in the x axis position since the last poll
dy
the difference in the y axis position since the last poll

Show TOC