Class Input
java.lang.Object
zombie.core.input.Input
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The controller index to pass to check all controllers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getAxisCount
(int index) get the number of axis that are avaiable on a given controllergetAxisName
(int index, int axis) get the name of the axis with the given indexfloat
getAxisValue
(int index, int axis) get the value of the axis with the given indexint
getButtonCount
(int index) getButtonName
(int index, int button) org.lwjglx.input.Controller
getController
(int int0) int
get a count of the number of controllers availablestatic int
getKeyCode
(String keyName) static String
getKeyName
(int code) get the character representation of the key identified by the specified codevoid
Initialise the controllers systemboolean
isButtonPressedD
(int button, int index) Check if controller button is pressedboolean
isButtonReleasePress
(int index, int button) boolean
isButtonStartPress
(int index, int button) boolean
isControllerDownD
(int index) Check if the controller has the down direction pressedboolean
isControllerLeftD
(int index) Check if the controller has the left direction pressedboolean
isControllerRightD
(int index) Check if the controller has the right direction pressedboolean
isControllerUpD
(int index) Check if the controller has the up direction pressedvoid
poll()
Poll the state of the inputvoid
quit()
void
boolean
wasButtonPressed
(int index, int button) Check if a controller button was pressed the previous frame.
-
Field Details
-
ANY_CONTROLLER
public static final int ANY_CONTROLLERThe controller index to pass to check all controllers- See Also:
-
-
Constructor Details
-
Input
public Input()
-
-
Method Details
-
getKeyName
get the character representation of the key identified by the specified code- Parameters:
code
- The key code of the key to retrieve the name of- Returns:
- The name or character representation of the key requested
-
getKeyCode
-
getControllerCount
public int getControllerCount()get a count of the number of controllers available- Returns:
- The number of controllers available
-
getAxisCount
public int getAxisCount(int index) get the number of axis that are avaiable on a given controller- Parameters:
index
- The index of the controller to check- Returns:
- The number of axis available on the controller
-
getAxisValue
public float getAxisValue(int index, int axis) get the value of the axis with the given index- Parameters:
index
- The index of the controller to checkaxis
- The index of the axis to read- Returns:
- The axis value at time of reading
-
getAxisName
get the name of the axis with the given index- Parameters:
index
- The index of the controller to checkaxis
- The index of the axis to read- Returns:
- The name of the specified axis
-
isControllerLeftD
public boolean isControllerLeftD(int index) Check if the controller has the left direction pressed- Parameters:
index
- The index of the controller to check- Returns:
- True if the controller is pressed to the left
-
isControllerRightD
public boolean isControllerRightD(int index) Check if the controller has the right direction pressed- Parameters:
index
- The index of the controller to check- Returns:
- True if the controller is pressed to the right
-
isControllerUpD
public boolean isControllerUpD(int index) Check if the controller has the up direction pressed- Parameters:
index
- The index of the controller to check- Returns:
- True if the controller is pressed to the up
-
isControllerDownD
public boolean isControllerDownD(int index) Check if the controller has the down direction pressed- Parameters:
index
- The index of the controller to check- Returns:
- True if the controller is pressed to the down
-
isButtonPressedD
public boolean isButtonPressedD(int button, int index) Check if controller button is pressed- Parameters:
button
- The index of the button to checkindex
- The index of the controller to check- Returns:
- True if the button is pressed
-
wasButtonPressed
public boolean wasButtonPressed(int index, int button) Check if a controller button was pressed the previous frame.- Parameters:
index
- The controller index.button
- The button index.- Returns:
- true if the controller button was in the pressed state the previous frame.
-
isButtonStartPress
public boolean isButtonStartPress(int index, int button) -
isButtonReleasePress
public boolean isButtonReleasePress(int index, int button) -
initControllers
public void initControllers()Initialise the controllers system -
poll
public void poll()Poll the state of the input -
getController
public org.lwjglx.input.Controller getController(int int0) -
getButtonCount
public int getButtonCount(int index) -
getButtonName
-
updateGameThread
public void updateGameThread() -
quit
public void quit()
-