GetNumJoysticks

From Spheriki

Jump to: navigation, search

Obtain the number of joysticks detected on the system, usable by Sphere.


Contents

Usage

number GetNumJoysticks();


Examples

var num_joysticks = GetNumJoysticks();
if (num_joysticks < 1)
  Abort("You have NO joysticks!");
else
  Abort("Good, you have " + num_joysticks + " joystick(s).");

This example checks how many joysticks Sphere can find.


Notes

  • This function determines the valid range of numbers for the other joystick-related functions. The range is 0 to GetNumJoysticks() - 1.
  • Many players will not have access to a joystick, so joystick input should be provided as an alternative to keyboard or mouse input, rather than a substitute.


See Also

Personal tools