|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.wisch.joystick.AbstractController
at.wisch.joystick.Joystick
public class Joystick
The class Joystick. This is the class that actually represents Joystick
objects, which are necessary for recieving input from a Joystick.
Attention: do not instantiate Joystick objects yourself. Aquire Joysticks
using JoystickManager
.
Field Summary |
---|
Fields inherited from class at.wisch.joystick.AbstractController |
---|
AXIS_DEFAULT_DEAD_ZONE, AXIS_MAXIMUM, AXIS_MINIMUM, AXIS_NEUTRAL, DEFAULT_AUTOCENTER_VALUE, DEFAULT_GAIN_VALUE, INFINITE_TIMES, POV_AXIS_NEGATIVE, POV_AXIS_NEUTRAL, POV_AXIS_POSITIVE, POV_CENTERED, POV_DOWN, POV_DOWN_LEFT, POV_DOWN_RIGHT, POV_LEFT, POV_RIGHT, POV_UP, POV_UP_LEFT, POV_UP_RIGHT |
Method Summary | |
---|---|
int |
getAxisCount()
Retrieve the number of axes available on this controller. |
float |
getAxisValue(int axisIndex)
Retrieve the value thats currently available on a specified axis. |
int |
getBallCount()
Gets the number of trackballs (balls) a device has. |
int[] |
getBallDelta(int ballIndex)
Gets the delta for the trackball specified by ballIndex. |
int |
getButtonCount()
Retrieve the number of buttons available on this controller. |
float |
getDeadZone(int axisIndex)
Get the dead zone for a specified axis. |
java.lang.String |
getDescription()
Gets a short description of the joystick's capabilities for input. |
int |
getIndex()
Gets the index of this controller in the collection. |
boolean |
getInvertAxis(int axisIndex)
Check if an analogue axis is being inverted. |
boolean |
getInvertBall(int ballIndex,
int xORy)
Check if a trackball's axis is being inverted. |
boolean |
getInvertPov(int povIndex,
int xORy)
Check if a POV's axis is being inverted. |
java.lang.String |
getName()
Gets the name assigned to this controller. |
int |
getPovCount()
Gets the device's point-of-view (POV) count. |
int |
getPovDirection(int povIndex)
Gets the direction of a POV. |
int |
getPovX(int povIndex)
Gets the X coordinate's value of a POV. |
int |
getPovY(int povIndex)
Gets the Y coordinate's value of a POV. |
boolean |
isButtonPressed(int buttonIndex)
Check if a button is currently pressed |
boolean |
isFFJoystick()
Checks if the device supports force feedback (FF). |
void |
poll()
Poll the controller for new data. |
void |
setDeadZone(int axisIndex,
float zone)
Set the dead zone for the specified axis. |
void |
setInvertAxis(int axisIndex,
boolean invert)
Sets if an analogue axis is to be inverted or not. |
void |
setInvertBall(int ballIndex,
int xORy,
boolean invert)
Sets if a trackball's axis is to be inverted or not. |
void |
setInvertPov(int povIndex,
int xORy,
boolean invert)
Sets if a POV's axis is to be inverted or not. |
java.lang.String |
toString()
Gets a string containing the joystick's name and the description of the input capabilities. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
getName()
,
getDescription()
public int getIndex()
getDescription()
public java.lang.String getName()
toString()
public boolean isFFJoystick()
FFJoystick
.
Checks if the device supports force feedback (FF).AdvancedFFController
.
FFJoystick
public java.lang.String getDescription()
toString()
,
getIndex()
,
getButtonCount()
,
getPovCount()
,
getAxisCount()
,
getBallCount()
public void poll()
public int getButtonCount()
AdvancedController.getPovCount()
,
Controller.getAxisCount()
,
AdvancedController.getBallCount()
public boolean isButtonPressed(int buttonIndex)
buttonIndex
- the index of the button to check
public int getPovCount()
Controller.getButtonCount()
,
Controller.getAxisCount()
,
AdvancedController.getBallCount()
public int getPovX(int povIndex)
povIndex
- the POV index (POV indices start from 0)
AdvancedController.getPovDirection(int)
public int getPovY(int povIndex)
povIndex
- the POV index (POV indices start from 0)
AdvancedController.getPovDirection(int)
public int getPovDirection(int povIndex)
setInvertPov(int, int, boolean)
does not affect the direction, but only the return value of getPovX(int)
and getPovY(int)
povIndex
- the POV index (POV indices start from 0)
AdvancedController.getPovX(int)
,
AdvancedController.getPovY(int)
public boolean getInvertPov(int povIndex, int xORy)
povIndex
- the POV's indexxORy
- 0 for X, 1 for Y
setInvertPov(int, int, boolean)
public void setInvertPov(int povIndex, int xORy, boolean invert)
getPovDirection(int)
povIndex
- the POV's indexxORy
- 0 for X, 1 for Yinvert
- true for do invert, false for do not invert (default)getInvertPov(int, int)
public int getAxisCount()
Controller.getButtonCount()
,
AdvancedController.getPovCount()
,
AdvancedController.getBallCount()
public float getAxisValue(int axisIndex)
axisIndex
- the index of axis to be read (axis indices start with 0)
public float getDeadZone(int axisIndex)
axisIndex
- the index of the axis for which to retrieve the dead zone (axis indices start with 0)
Controller.setDeadZone(int, float)
public void setDeadZone(int axisIndex, float zone)
axisIndex
- the index of the axis for which to set the dead zone (axis indices start with 0)zone
- the dead zone to use for the specified axis: a value from 0 to AXIS_MAXIMUM (1f)Controller.getDeadZone(int)
public boolean getInvertAxis(int axisIndex)
axisIndex
- the axis' index
setInvertAxis(int, boolean)
public void setInvertAxis(int axisIndex, boolean invert)
axisIndex
- the axis' indexinvert
- true for do invert, false for do not invert (default)getInvertAxis(int)
public int getBallCount()
AdvancedController.getPovCount()
,
Controller.getAxisCount()
public int[] getBallDelta(int ballIndex)
ballIndex
- the trackball index (ball indices start from 0)
public boolean getInvertBall(int ballIndex, int xORy)
ballIndex
- the trackball's indexxORy
- 0 for X, 1 for Y
setInvertBall(int, int, boolean)
public void setInvertBall(int ballIndex, int xORy, boolean invert)
ballIndex
- the trackball's indexxORy
- 0 for X, 1 for Yinvert
- true for do invert, false for do not invert (default)getInvertBall(int, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |