|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.action.input.ControlID
public final class ControlID
Represents a particular control attached to an InputDevice.
Each ControlID is composed of three values: a device index, a control
index, and a control type constant. The device index indicates, given an
array of InputDevices, which of the devices should be used. The type
constant indicates what kind of control on the InputDevice should be used and
how to use it. This will be one of the TYPE_* constants in this class. The
control index indicates which of the controls of the given type to use.
API Stability: Beta; I'm going to add TYPE_ constants for the
mouse axes.
Field Summary | |
---|---|
static int |
TYPE_BUTTON
Use a button; pressed will be one, unpressed will be zero. |
static int |
TYPE_FUZZY
Use a fuzzy axis' full range. |
static int |
TYPE_FUZZY_NEGETIVE
Use absolute value of a fuzzy axis' negetive range. |
static int |
TYPE_FUZZY_POSITIVE
Use a fuzzy axis' positive range. |
static int |
TYPE_FUZZY_THROTTLE
Use a fuzzy axis as a throttle slider. |
static int |
TYPE_HAT_CENTER
Use a POV hat; center will be one and anything else will be zero. |
static int |
TYPE_HAT_DOWN
Use a POV hat; down will be one and center will be zero. |
static int |
TYPE_HAT_DOWN_UP
Use a POV hat; down will be negetive one, center will be zero, up will be one. |
static int |
TYPE_HAT_LEFT
Use a POV hat; left will be one and center will be zero. |
static int |
TYPE_HAT_LEFT_RIGHT
Use a POV hat; left will be negetive one, center will be zero, right will be one. |
static int |
TYPE_HAT_RIGHT
Use a POV hat; right will be one and center will be zero. |
static int |
TYPE_HAT_RIGHT_LEFT
Use a POV hat; right will be negetive one, center will be zero, left will be one. |
static int |
TYPE_HAT_UP
Use a POV hat; up will be one and center will be zero. |
static int |
TYPE_HAT_UP_DOWN
Use a POV hat; up will be negetive one, center will be zero, down will be one. |
Constructor Summary | |
---|---|
ControlID(int device,
int control,
int controlType)
Constructs a ControlID. |
Method Summary | |
---|---|
java.lang.String |
controlString()
Returns a String representing the control. |
boolean |
equals(java.lang.Object obj)
|
int |
getControlIndex()
Returns the control index. |
int |
getControlType()
Returns the control type constant. |
int |
getDeviceIndex()
Returns the device index. |
int |
hashCode()
|
boolean |
isButton()
Is this refering to a button? |
boolean |
isFuzzy()
Is this refering to a fuzzy axis? |
boolean |
isPOVHat()
Is this refering to a POV hat? |
java.lang.String |
toString()
Returns the following: getDeviceIndex() + ":" + controlString(); |
java.lang.String |
toString(InputDevice dev)
Returns the following: getDeviceIndex() + ":" + dev.getName() + ":" + controlString(); |
java.lang.String |
typeString()
Returns a short text representation of the type constant. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_FUZZY
public static final int TYPE_FUZZY_POSITIVE
public static final int TYPE_FUZZY_NEGETIVE
public static final int TYPE_FUZZY_THROTTLE
public static final int TYPE_BUTTON
public static final int TYPE_HAT_UP
public static final int TYPE_HAT_DOWN
public static final int TYPE_HAT_LEFT
public static final int TYPE_HAT_RIGHT
public static final int TYPE_HAT_CENTER
public static final int TYPE_HAT_LEFT_RIGHT
public static final int TYPE_HAT_RIGHT_LEFT
public static final int TYPE_HAT_UP_DOWN
public static final int TYPE_HAT_DOWN_UP
Constructor Detail |
---|
public ControlID(int device, int control, int controlType)
device
- the device index.control
- the control index.controlType
- the control type constant.
java.lang.IllegalArgumentException
- if controlType is invalid, or if one of
device or control is less than zero.Method Detail |
---|
public boolean isFuzzy()
public boolean isButton()
public boolean isPOVHat()
public int getDeviceIndex()
public int getControlType()
public int getControlIndex()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String typeString()
public java.lang.String controlString()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(InputDevice dev)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |