Top Description Fields Constructors Methods
org.lwjgl.input

pack-priv Class ControllerEvent

extends Object
Class Inheritance

An event occuring on a controller.
Author
Kevin Glass

Field Summary

Modifier and TypeField and Description
public static final int
AXIS

Indicates the event was caused by a axis

public static final int
BUTTON

Indicates the event was caused by a button

private boolean
buttonState

True when a button is pressed, if this event was caused by the button

private int
index

The index of the input (axis or button) that generated the event

public static final int
POVX

Indicates the event was caused by a pov X

public static final int
POVY

Indicates the event was caused by a pov Y

private Controller
source

The controller generating the event

private long
timeStamp

The time stamp of this event

private int
type

Type of control that generated the event

private boolean
xaxis

True if this event was caused by the x axis

private float
xaxisValue

The value on a specified axis, if this event was caused by the x-axis

private boolean
yaxis

True if this event was caused by the y axis

private float
yaxisValue

The value on a specified axis, if this event was caused by the y-axis

Constructor Summary

AccessConstructor and Description
pack-priv
ControllerEvent(Controller
The source of the event
source
,
long
The time stamp given for this event
timeStamp
,
int
The type of control generating this event
type
,
int
The index of the input that generated the event
index
,
boolean
True if this event was caused by the x-axis
xaxis
,
boolean
True if this event was caused by the y-axis
yaxis
)

Create a new event

pack-priv
ControllerEvent(Controller
The source of the event
source
,
long
The time stamp given for this event
timeStamp
,
int
The type of control generating this event
type
,
int
The index of the input that generated the event
index
,
boolean
True when a button is pressed, if this event was caused by the button
buttonState
,
boolean
True if this event was caused by the x-axis
xaxis
,
boolean
True if this event was caused by the y-axis
yaxis
,
float
The value on a specified axis, if this event was caused by the x-axis
xaxisValue
,
float
The value on a specified axis, if this event was caused by the y-axis
yaxisValue
)

Create a new event

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True when a button is pressed, if this event was caused by the button
getButtonState
()

Check the button is pressed or not, when this event was caused

public int

Returns:

The index of the control generating this event
getControlIndex
()

Get the index of the control generating this event

public Controller

Returns:

The controller that generated this event
getSource
()

Get the controller that generated this event

public long

Returns:

The time stamp given for this event
getTimeStamp
()

Get the time stamp given for this event.

public float

Returns:

The value on a specified axis, if this event was caused by the x-axis
getXAxisValue
()

Get the value on an X axis when this event was caused

public float

Returns:

The value on a specified axis, if this event was caused by the y-axis
getYAxisValue
()

Get the value on an Y axis when this event was caused

public boolean

Returns:

True if this event was generated by a axis
isAxis
()

Check if this event was generated by a axis

public boolean

Returns:

True if this event was generated by a button
isButton
()

Check if this event was generated by a button

public boolean

Returns:

True if this event was generated by a pov
isPovX
()

Check if this event was generated by a pov

public boolean

Returns:

True if this event was generated by a pov
isPovY
()

Check if this event was generated by a pov

public boolean

Returns:

True if this event was caused by the X axis
isXAxis
()

Check if this event was caused by the X axis

public boolean

Returns:

True if this event was caused by the Y axis
isYAxis
()

Check if this event was caused by the Y axis

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

AXISback to summary
public static final int AXIS

Indicates the event was caused by a axis

BUTTONback to summary
public static final int BUTTON

Indicates the event was caused by a button

buttonStateback to summary
private boolean buttonState

True when a button is pressed, if this event was caused by the button

indexback to summary
private int index

The index of the input (axis or button) that generated the event

POVXback to summary
public static final int POVX

Indicates the event was caused by a pov X

POVYback to summary
public static final int POVY

Indicates the event was caused by a pov Y

sourceback to summary
private Controller source

The controller generating the event

timeStampback to summary
private long timeStamp

The time stamp of this event

typeback to summary
private int type

Type of control that generated the event

xaxisback to summary
private boolean xaxis

True if this event was caused by the x axis

xaxisValueback to summary
private float xaxisValue

The value on a specified axis, if this event was caused by the x-axis

yaxisback to summary
private boolean yaxis

True if this event was caused by the y axis

yaxisValueback to summary
private float yaxisValue

The value on a specified axis, if this event was caused by the y-axis

Constructor Detail

ControllerEventback to summary
pack-priv ControllerEvent(Controller source, long timeStamp, int type, int index, boolean xaxis, boolean yaxis)

Create a new event

Parameters
source:Controller

The source of the event

timeStamp:long

The time stamp given for this event

type:int

The type of control generating this event

index:int

The index of the input that generated the event

xaxis:boolean

True if this event was caused by the x-axis

yaxis:boolean

True if this event was caused by the y-axis

ControllerEventback to summary
pack-priv ControllerEvent(Controller source, long timeStamp, int type, int index, boolean buttonState, boolean xaxis, boolean yaxis, float xaxisValue, float yaxisValue)

Create a new event

Parameters
source:Controller

The source of the event

timeStamp:long

The time stamp given for this event

type:int

The type of control generating this event

index:int

The index of the input that generated the event

buttonState:boolean

True when a button is pressed, if this event was caused by the button

xaxis:boolean

True if this event was caused by the x-axis

yaxis:boolean

True if this event was caused by the y-axis

xaxisValue:float

The value on a specified axis, if this event was caused by the x-axis

yaxisValue:float

The value on a specified axis, if this event was caused by the y-axis

Method Detail

getButtonStateback to summary
public boolean getButtonState()

Check the button is pressed or not, when this event was caused

Returns:boolean

True when a button is pressed, if this event was caused by the button

getControlIndexback to summary
public int getControlIndex()

Get the index of the control generating this event

Returns:int

The index of the control generating this event

getSourceback to summary
public Controller getSource()

Get the controller that generated this event

Returns:Controller

The controller that generated this event

getTimeStampback to summary
public long getTimeStamp()

Get the time stamp given for this event. As with nanoTime() this value means nothing other than giving ordering

Returns:long

The time stamp given for this event

getXAxisValueback to summary
public float getXAxisValue()

Get the value on an X axis when this event was caused

Returns:float

The value on a specified axis, if this event was caused by the x-axis

getYAxisValueback to summary
public float getYAxisValue()

Get the value on an Y axis when this event was caused

Returns:float

The value on a specified axis, if this event was caused by the y-axis

isAxisback to summary
public boolean isAxis()

Check if this event was generated by a axis

Returns:boolean

True if this event was generated by a axis

isButtonback to summary
public boolean isButton()

Check if this event was generated by a button

Returns:boolean

True if this event was generated by a button

isPovXback to summary
public boolean isPovX()

Check if this event was generated by a pov

Returns:boolean

True if this event was generated by a pov

isPovYback to summary
public boolean isPovY()

Check if this event was generated by a pov

Returns:boolean

True if this event was generated by a pov

isXAxisback to summary
public boolean isXAxis()

Check if this event was caused by the X axis

Returns:boolean

True if this event was caused by the X axis

isYAxisback to summary
public boolean isYAxis()

Check if this event was caused by the Y axis

Returns:boolean

True if this event was caused by the Y axis

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object