Top Description Methods
org.lwjgl.input

public Interface Controller

Known Direct Implementers
org.lwjgl.input.JInputController, org.lwjgl.util.input.ControllerAdapter

A game controller of some sort that will provide input. The controller presents buttons and axes. Buttons are either pressed or not pressed. Axis provide analogue values.
Author
Kevin Glass

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The number of axes available on this controller.
getAxisCount
()

Retrieve the number of axes available on this controller.

public String

Returns:

The name of the specified axis.
getAxisName
(int
The index of the axis whose name should be retrieved
index
)

Get the name that's given to the specified axis

public float

Returns:

The value from the specified axis.
getAxisValue
(int
The index of axis to be read
index
)

Retrieve the value thats currently available on a specified axis.

public int

Returns:

The number of butotns available on this controller
getButtonCount
()

Retrieve the number of buttons available on this controller

public String

Returns:

The name of the button requested
getButtonName
(int
The index of the button whose name should be retrieved
index
)

Get the name of the specified button.

public float

Returns:

The dead zone for the specified axis
getDeadZone
(int
The index of the axis for which to retrieve the dead zone
index
)

Get the dead zone for a specified axis

public int

Returns:

The index of this controller in the collection
getIndex
()

Get the index of this controller in the collection

public String

Returns:

The name assigned to this controller
getName
()

Get the name assigned to this controller.

public float

Returns:

The X-Axis value of the POV on this controller
getPovX
()

Get the X-Axis value of the POV on this controller

public float

Returns:

The Y-Axis value of the POV on this controller
getPovY
()

Get the Y-Axis value of the POV on this controller

public int
getRumblerCount()

Returns the number of rumblers this controller supports

public String
getRumblerName(int
The rumbler index
index
)

Returns the name of the specified rumbler

public float

Returns:

The dead zone for the RX axis
getRXAxisDeadZone
()

Get the dead zone for the RX axis.

public float

Returns:

The value from the RX axis
getRXAxisValue
()

Get the value from the RX axis if there is one.

public float

Returns:

The dead zone for the RY axis
getRYAxisDeadZone
()

Get the dead zone for the RY axis.

public float

Returns:

The value from the RY axis
getRYAxisValue
()

Get the value from the RY axis if there is one.

public float

Returns:

The dead zone for the RZ axis
getRZAxisDeadZone
()

Get the dead zone for the RZ axis.

public float

Returns:

The value from the RZ axis
getRZAxisValue
()

Get the value from the RZ axis if there is one.

public float

Returns:

The dead zone for the X axis
getXAxisDeadZone
()

Get the dead zone for the X axis.

public float

Returns:

The value from the X axis
getXAxisValue
()

Get the value from the X axis if there is one.

public float

Returns:

The dead zone for the Y axis
getYAxisDeadZone
()

Get the dead zone for the Y axis.

public float

Returns:

The value from the Y axis
getYAxisValue
()

Get the value from the Y axis if there is one.

public float

Returns:

The dead zone for the Z axis
getZAxisDeadZone
()

Get the dead zone for the Z axis.

public float

Returns:

The value from the Z axis
getZAxisValue
()

Get the value from the Z axis if there is one.

public boolean

Returns:

True if the button is currently pressed
isButtonPressed
(int
The button to check
index
)

Check if a button is currently pressed

public void
poll()

Poll the controller for new data.

public void
setDeadZone(int
The index of hte axis for which to set the dead zone
index
,
float
The dead zone to use for the specified axis
zone
)

Set the dead zone for the specified axis

public void
setRumblerStrength(int
The index of the rumbler
index
,
float
The strength to vibrate at
strength
)

Sets the vibration strength of the specified rumbler

public void
setRXAxisDeadZone(float
The dead zone to use for the RX axis
zone
)

Set the dead zone for the RX axis

public void
setRYAxisDeadZone(float
The dead zone to use for the RY axis
zone
)

Set the dead zone for the RY axis

public void
setRZAxisDeadZone(float
The dead zone to use for the RZ axis
zone
)

Set the dead zone for the RZ axis

public void
setXAxisDeadZone(float
The dead zone to use for the X axis
zone
)

Set the dead zone for the X axis

public void
setYAxisDeadZone(float
The dead zone to use for the Y axis
zone
)

Set the dead zone for the Y axis

public void
setZAxisDeadZone(float
The dead zone to use for the Z axis
zone
)

Set the dead zone for the Z axis

Method Detail

getAxisCountback to summary
public int getAxisCount()

Retrieve the number of axes available on this controller.

Returns:int

The number of axes available on this controller.

getAxisNameback to summary
public String getAxisName(int index)

Get the name that's given to the specified axis

Parameters
index:int

The index of the axis whose name should be retrieved

Returns:String

The name of the specified axis.

getAxisValueback to summary
public float getAxisValue(int index)

Retrieve the value thats currently available on a specified axis. The value will always be between 1.0 and -1.0 and will calibrate as values are passed read. It may be useful to get the player to wiggle the joystick from side to side to get the calibration right.

Parameters
index:int

The index of axis to be read

Returns:float

The value from the specified axis.

getButtonCountback to summary
public int getButtonCount()

Retrieve the number of buttons available on this controller

Returns:int

The number of butotns available on this controller

getButtonNameback to summary
public String getButtonName(int index)

Get the name of the specified button. Be warned, often this is as exciting as "Button X"

Parameters
index:int

The index of the button whose name should be retrieved

Returns:String

The name of the button requested

getDeadZoneback to summary
public float getDeadZone(int index)

Get the dead zone for a specified axis

Parameters
index:int

The index of the axis for which to retrieve the dead zone

Returns:float

The dead zone for the specified axis

getIndexback to summary
public int getIndex()

Get the index of this controller in the collection

Returns:int

The index of this controller in the collection

getNameback to summary
public String getName()

Get the name assigned to this controller.

Returns:String

The name assigned to this controller

getPovXback to summary
public float getPovX()

Get the X-Axis value of the POV on this controller

Returns:float

The X-Axis value of the POV on this controller

getPovYback to summary
public float getPovY()

Get the Y-Axis value of the POV on this controller

Returns:float

The Y-Axis value of the POV on this controller

getRumblerCountback to summary
public int getRumblerCount()

Returns the number of rumblers this controller supports

getRumblerNameback to summary
public String getRumblerName(int index)

Returns the name of the specified rumbler

Parameters
index:int

The rumbler index

getRXAxisDeadZoneback to summary
public float getRXAxisDeadZone()

Get the dead zone for the RX axis.

Returns:float

The dead zone for the RX axis

getRXAxisValueback to summary
public float getRXAxisValue()

Get the value from the RX axis if there is one. If no RX axis is defined a zero value will be returned.

Returns:float

The value from the RX axis

getRYAxisDeadZoneback to summary
public float getRYAxisDeadZone()

Get the dead zone for the RY axis.

Returns:float

The dead zone for the RY axis

getRYAxisValueback to summary
public float getRYAxisValue()

Get the value from the RY axis if there is one. If no RY axis is defined a zero value will be returned.

Returns:float

The value from the RY axis

getRZAxisDeadZoneback to summary
public float getRZAxisDeadZone()

Get the dead zone for the RZ axis.

Returns:float

The dead zone for the RZ axis

getRZAxisValueback to summary
public float getRZAxisValue()

Get the value from the RZ axis if there is one. If no RZ axis is defined a zero value will be returned.

Returns:float

The value from the RZ axis

getXAxisDeadZoneback to summary
public float getXAxisDeadZone()

Get the dead zone for the X axis.

Returns:float

The dead zone for the X axis

getXAxisValueback to summary
public float getXAxisValue()

Get the value from the X axis if there is one. If no X axis is defined a zero value will be returned.

Returns:float

The value from the X axis

getYAxisDeadZoneback to summary
public float getYAxisDeadZone()

Get the dead zone for the Y axis.

Returns:float

The dead zone for the Y axis

getYAxisValueback to summary
public float getYAxisValue()

Get the value from the Y axis if there is one. If no Y axis is defined a zero value will be returned.

Returns:float

The value from the Y axis

getZAxisDeadZoneback to summary
public float getZAxisDeadZone()

Get the dead zone for the Z axis.

Returns:float

The dead zone for the Z axis

getZAxisValueback to summary
public float getZAxisValue()

Get the value from the Z axis if there is one. If no Z axis is defined a zero value will be returned.

Returns:float

The value from the Z axis

isButtonPressedback to summary
public boolean isButtonPressed(int index)

Check if a button is currently pressed

Parameters
index:int

The button to check

Returns:boolean

True if the button is currently pressed

pollback to summary
public void poll()

Poll the controller for new data. This will also update events

setDeadZoneback to summary
public void setDeadZone(int index, float zone)

Set the dead zone for the specified axis

Parameters
index:int

The index of hte axis for which to set the dead zone

zone:float

The dead zone to use for the specified axis

setRumblerStrengthback to summary
public void setRumblerStrength(int index, float strength)

Sets the vibration strength of the specified rumbler

Parameters
index:int

The index of the rumbler

strength:float

The strength to vibrate at

setRXAxisDeadZoneback to summary
public void setRXAxisDeadZone(float zone)

Set the dead zone for the RX axis

Parameters
zone:float

The dead zone to use for the RX axis

setRYAxisDeadZoneback to summary
public void setRYAxisDeadZone(float zone)

Set the dead zone for the RY axis

Parameters
zone:float

The dead zone to use for the RY axis

setRZAxisDeadZoneback to summary
public void setRZAxisDeadZone(float zone)

Set the dead zone for the RZ axis

Parameters
zone:float

The dead zone to use for the RZ axis

setXAxisDeadZoneback to summary
public void setXAxisDeadZone(float zone)

Set the dead zone for the X axis

Parameters
zone:float

The dead zone to use for the X axis

setYAxisDeadZoneback to summary
public void setYAxisDeadZone(float zone)

Set the dead zone for the Y axis

Parameters
zone:float

The dead zone to use for the Y axis

setZAxisDeadZoneback to summary
public void setZAxisDeadZone(float zone)

Set the dead zone for the Z axis

Parameters
zone:float

The dead zone to use for the Z axis