public final class SDL_Joystick
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
float |
AXIS_MAX |
float |
AXIS_MIN |
SDL_JoystickID |
instanceID
This is a unique ID for a joystick for the time it is connected to the system,
and is never reused for the lifetime of the application.
|
long |
ptr |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close a joystick previously opened with SDL_JoystickOpen().
|
int |
currentPowerLevel()
Return the battery level of this joystick
SDL_JOYSTICK_POWER_UNKNOWN = -1,
SDL_JOYSTICK_POWER_EMPTY = 0,
SDL_JOYSTICK_POWER_LOW =1,
SDL_JOYSTICK_POWER_MEDIUM =2,
SDL_JOYSTICK_POWER_FULL =3,
SDL_JOYSTICK_POWER_WIRED =4,
SDL_JOYSTICK_POWER_MAX =5;
|
boolean |
equals(java.lang.Object o) |
static boolean |
eventStateEnable() |
static boolean |
eventStateIgnore() |
static boolean |
eventStateQuery() |
boolean |
getAttached()
Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not.
|
float |
getAxis(int axis)
Get the current state of an axis control on a joystick.
|
boolean |
getButton(int button)
Get the current state of a button on a joystick.
|
int |
getHat(int hat)
Get the current state of a POV hat on a joystick.
|
java.lang.String |
GUID() |
int |
hashCode() |
SDL_JoystickID |
instanceID() |
static SDL_Joystick |
joystickFromInstanceID(SDL_JoystickID joyid) |
static java.lang.String |
joystickNameForIndex(int device_index)
Get the implementation dependent name of a joystick.
|
static SDL_Joystick |
JoystickOpen(int i) |
static void |
joystickUpdate()
Update the current state of the open joysticks.
|
java.lang.String |
name() |
int |
numAxes()
Get the number of general axis controls on a joystick.
|
int |
numBalls()
Get the number of trackballs on a joystick.
|
int |
numButtons()
Get the number of buttons on a joystick.
|
int |
numHats()
Get the number of POV hats on a joystick.
|
static int |
numJoysticks()
Count the number of joysticks attached to the system right now
|
static int |
productVersion(int device_index) |
boolean |
rumble(float leftMagnitude,
float rightMagnitude,
int duration_ms)
Trigger a rumble effect
Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
|
public long ptr
public final float AXIS_MIN
public final float AXIS_MAX
public final SDL_JoystickID instanceID
public static SDL_Joystick joystickFromInstanceID(SDL_JoystickID joyid)
public static java.lang.String joystickNameForIndex(int device_index)
public static SDL_Joystick JoystickOpen(int i)
public static void joystickUpdate()
public static int numJoysticks() throws SDL_Error
SDL_Error
public boolean getAttached()
public float getAxis(int axis)
public boolean getButton(int button)
public int currentPowerLevel()
public int getHat(int hat)
public SDL_JoystickID instanceID()
public java.lang.String name()
public int numAxes() throws SDL_Error
SDL_Error
public int numButtons() throws SDL_Error
SDL_Error
public int numBalls() throws SDL_Error
SDL_Error
public int numHats() throws SDL_Error
SDL_Error
public void close()
public java.lang.String GUID()
public static int productVersion(int device_index)
public boolean rumble(float leftMagnitude, float rightMagnitude, int duration_ms)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object