public final class SDL_GameController
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
boolean |
addMapping(java.lang.String mappingString) |
static boolean |
addMappingsFromFile(java.lang.String path) |
static boolean |
addMappingsFromFile(java.lang.String path,
java.lang.Class sourceClass)
This method adds mappings held in the specified file.
|
void |
close() |
boolean |
equals(java.lang.Object o) |
static boolean |
eventStateEnable() |
static boolean |
eventStateIgnore() |
static boolean |
eventStateQuery() |
static SDL_GameController |
GameControllerFromInstanceID(SDL_GameControllerID joyid) |
static java.lang.String |
GameControllerNameForIndex(int device_index)
Get the implementation dependent name of a game controller.
|
static SDL_GameController |
GameControllerOpen(int i) |
static void |
GameControllerUpdate() |
boolean |
getAttached() |
float |
getAxis(int axis) |
boolean |
getButton(int button) |
int |
getPlayerIndex()
Get the player index of an opened game controller, or -1 if it's not available
For XInput controllers this returns the XInput user index.
|
int |
getType()
Return the type of this currently opened controller
|
int |
hashCode() |
boolean |
isGameController(int joystick_index) |
java.lang.String |
name() |
static SDL_GameController |
SDL_GameControllerFromPlayerIndex(int player_index)
Return the SDL_GameController associated with a player index.
|
void |
setPlayerIndex(int player_index)
Set the player index of an opened game controller
|
public void close()
public boolean getAttached()
public float getAxis(int axis)
public boolean getButton(int button)
public java.lang.String name()
public static boolean addMappingsFromFile(java.lang.String path, java.lang.Class sourceClass) throws java.io.IOException, java.lang.IllegalStateException, SDL_Error
path
- The path to the file containing controller mappings.java.io.IOException
- if the file cannot be read, copied to a temp folder, or deleted.java.lang.IllegalStateException
- if the mappings cannot be applied to SDLSDL_Error
public static boolean addMappingsFromFile(java.lang.String path) throws java.io.IOException, java.lang.IllegalStateException, SDL_Error
java.io.IOException
java.lang.IllegalStateException
SDL_Error
public boolean addMapping(java.lang.String mappingString) throws SDL_Error
SDL_Error
public static SDL_GameController GameControllerFromInstanceID(SDL_GameControllerID joyid)
public static SDL_GameController SDL_GameControllerFromPlayerIndex(int player_index)
public static java.lang.String GameControllerNameForIndex(int device_index)
public int getType()
public int getPlayerIndex()
public void setPlayerIndex(int player_index)
public static SDL_GameController GameControllerOpen(int i)
public static void GameControllerUpdate()
public boolean isGameController(int joystick_index)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object