X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-Joystick.html-inc;h=14dd677a981262c149a0532bf9bba91f4cb4230c;hb=a3de848879a5553418ed11fb193c4bf286ca7120;hp=9da305afe8c75518fbcab1776097caff800b783b;hpb=46beffd8f76fe150d946bf61c780e61de2affbdf;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-Joystick.html-inc b/pages/SDL-Joystick.html-inc index 9da305a..14dd677 100644 --- a/pages/SDL-Joystick.html-inc +++ b/pages/SDL-Joystick.html-inc @@ -8,7 +8,7 @@
object SDL::Joystick::open( index ); +new
++object SDL::Joystick->new( index );Opens a joystick for use within SDL. The
if(SDL::Joystick::num_joysticks() > 0) { # Open joystick - my $joystick = SDL::Joystick::open(0); + my $joystick = SDL::Joystick->new(0); if($joystick) { @@ -131,7 +132,7 @@ A joystick must be opened before it can be used.index
refers to the N'th joystick in the system. @@ -95,7 +96,7 @@ A joystick must be opened before it can be used.int SDL::Joystick::index( object );-Returns the
+index
of a givenSDL_Joystick
structure. See SDL::Joystick::openReturns the
index
of a givenSDL_Joystick
structure. See SDL::Joystick::newnum_axes
@@ -139,7 +140,7 @@ A joystick must be opened before it can be used.int SDL::Joystick::num_axes( object );-Return the number of axes available from a previously opened joystick. See SDL::Joystick::open
+Return the number of axes available from a previously opened joystick. See SDL::Joystick::new
int SDL::Joystick::num_balls( object );-
Return the number of trackballs available from a previously opened joystick. See SDL::Joystick::open
+Return the number of trackballs available from a previously opened joystick. See SDL::Joystick::new
int SDL::Joystick::num_hats( object );-
Gets the number of joystick hats from a previously opened joystick. See SDL::Joystick::open
+Gets the number of joystick hats from a previously opened joystick. See SDL::Joystick::new
int SDL::Joystick::num_buttons( object );-
Gets the number of joystick buttons from a previously opened joystick. See SDL::Joystick::open
+Gets the number of joystick buttons from a previously opened joystick. See SDL::Joystick::new
get_axis
is a signed integer (-32768 to 32767
it may be necessary to impose certain tolerances on these values to account for jitter.
Note: Some joysticks use axes 2 and 3 for extra buttons.
Returns a 16-bit signed integer representing the current position of the axis.
-my $joystick = SDL::Joystick::open(0); +my $joystick = SDL::Joystick->new(0); my $x_move = SDL::Joystick::get_axis($joystick, 0); my $y_move = SDL::Joystick::get_axis($joystick, 1); @@ -210,7 +211,7 @@ it may be necessary to impose certain tolerances on these values to account for
SDL_HAT_LEFTDOWN
my $joystick = SDL::Joystick::open(0); +my $joystick = SDL::Joystick->new(0); my $position = SDL::Joystick::get_hat($joystick, 0); @@ -226,7 +227,7 @@ it may be necessary to impose certain tolerances on these values to account for
get_button
returns the current state of the given button on the given joystick.Returns 1 if the button is pressed. Otherwise, 0.
-my $joystick = SDL::Joystick::open(0); +my $joystick = SDL::Joystick->new(0); my $num_buttons = SDL::Joystick::num_buttons($joystick); @@ -250,7 +251,7 @@ it may be necessary to impose certain tolerances on these values to account forReturns 0 on success or -1 on failure
my $delta_x = 0; my $delta_y = 0; - my $joystick = SDL::Joystick::open(0); + my $joystick = SDL::Joystick->new(0); SDL::Joystick::update(); @@ -265,10 +266,15 @@ it may be necessary to impose certain tolerances on these values to account forvoid SDL::Joystick::close( object );-Closes a previously opened joystick. See SDL::Joystick::open
+Closes a previously opened joystick. See SDL::Joystick::new
SDL::Joystick::close($joystick) if SDL::Joystick::opened(0);+AUTHORS
++\ No newline at end of fileSee AUTHORS in SDL.
+ +