|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.EventObject
com.threerings.opengl.gui.event.Event
com.threerings.opengl.gui.event.InputEvent
com.threerings.opengl.gui.event.ControllerEvent
public class ControllerEvent
Encapsulates the information associated with a controller (joystick, gamepad) event.
| Field Summary | |
|---|---|
protected int |
_controlIndex
The index of the control (button or axis) that caused the event. |
protected int |
_type
The type of the event. |
protected float |
_value
The value of the axis. |
protected boolean |
_xAxis
Whether or not the axis is the x axis. |
protected boolean |
_yAxis
Whether or not the axis is the y axis. |
static int |
CONTROLLER_MOVED
An event generated when the controller is moved on an axis. |
static int |
CONTROLLER_POV_X_MOVED
An event generated when the controller's pov is moved on the x axis. |
static int |
CONTROLLER_POV_Y_MOVED
An event generated when the controller's pov is moved on the y axis. |
static int |
CONTROLLER_PRESSED
An event generated when a controller button is pressed. |
static int |
CONTROLLER_RELEASED
An event generated when a controller button is released. |
| Fields inherited from class com.threerings.opengl.gui.event.InputEvent |
|---|
_modifiers, ALT_DOWN_MASK, BUTTON1_DOWN_MASK, BUTTON2_DOWN_MASK, BUTTON3_DOWN_MASK, CTRL_DOWN_MASK, META_DOWN_MASK, SHIFT_DOWN_MASK |
| Fields inherited from class com.threerings.opengl.gui.event.Event |
|---|
_consumed, _when |
| Fields inherited from class java.util.EventObject |
|---|
source |
| Constructor Summary | |
|---|---|
ControllerEvent(Controller source,
long when,
int modifiers,
int type,
float value)
Creates a new controller pov event. |
|
ControllerEvent(Controller source,
long when,
int modifiers,
int type,
int controlIndex)
Creates a new controller button event. |
|
ControllerEvent(Controller source,
long when,
int modifiers,
int type,
int controlIndex,
boolean xAxis,
boolean yAxis,
float value)
Creates a new controller event. |
|
| Method Summary | |
|---|---|
void |
dispatch(ComponentListener listener)
Instructs this event to notify the supplied listener if they implement an interface appropriate to this event. |
int |
getControlIndex()
Returns the index of the control (button or axis) that caused the event, or -1 if not caused by a button or axis. |
Controller |
getController()
Returns a reference to the controller that caused the event. |
int |
getType()
Returns the type of this event, one of CONTROLLER_PRESSED,
{#link CONTROLLER_RELEASED}, etc. |
float |
getValue()
Returns the value corresponding to the event. |
boolean |
isXAxis()
Checks whether the event pertains to the x axis. |
boolean |
isYAxis()
Checks whether the event pertains to the y axis. |
protected void |
toString(StringBuilder buf)
|
| Methods inherited from class com.threerings.opengl.gui.event.InputEvent |
|---|
getModifiers, isAltDown, isControlDown, isMetaDown, isShiftDown |
| Methods inherited from class com.threerings.opengl.gui.event.Event |
|---|
consume, getWhen, isConsumed, propagateUpHierarchy, toString |
| Methods inherited from class java.util.EventObject |
|---|
getSource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int CONTROLLER_PRESSED
public static final int CONTROLLER_RELEASED
public static final int CONTROLLER_MOVED
public static final int CONTROLLER_POV_X_MOVED
public static final int CONTROLLER_POV_Y_MOVED
protected int _type
protected int _controlIndex
protected boolean _xAxis
protected boolean _yAxis
protected float _value
| Constructor Detail |
|---|
public ControllerEvent(Controller source,
long when,
int modifiers,
int type,
int controlIndex)
public ControllerEvent(Controller source,
long when,
int modifiers,
int type,
float value)
public ControllerEvent(Controller source,
long when,
int modifiers,
int type,
int controlIndex,
boolean xAxis,
boolean yAxis,
float value)
| Method Detail |
|---|
public Controller getController()
public int getType()
CONTROLLER_PRESSED,
{#link CONTROLLER_RELEASED}, etc.
public int getControlIndex()
public boolean isXAxis()
public boolean isYAxis()
public float getValue()
public void dispatch(ComponentListener listener)
Event
dispatch in class Eventprotected void toString(StringBuilder buf)
toString in class InputEvent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||