|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttv.ouya.console.api.OuyaController
public class OuyaController
Utility class that contains codes for console buttons and axes.
Field Summary | |
---|---|
static int |
AXIS_L2
Code for the left trigger axis. |
static int |
AXIS_LS_X
Code for the left joystick x axis. |
static int |
AXIS_LS_Y
Code for the left joystick y axis. |
static int |
AXIS_R2
Code for the right trigger axis. |
static int |
AXIS_RS_X
Code for the right joystick x axis. |
static int |
AXIS_RS_Y
Code for the right joystick y axis. |
static int |
BUTTON_A
Code for the A button. |
static int |
BUTTON_DPAD_DOWN
Code for the D-pad down button. |
static int |
BUTTON_DPAD_LEFT
Code for the D-pad left button. |
static int |
BUTTON_DPAD_RIGHT
Code for the D-pad right button. |
static int |
BUTTON_DPAD_UP
Code for the D-pad up button. |
static int |
BUTTON_L1
Code for the left bumper button. |
static int |
BUTTON_L2
Deprecated. This code is unreliable on some controller firmwares. Use of analog axis value is recommended. |
static int |
BUTTON_L3
Code for left joystick button. |
static int |
BUTTON_MENU
Code for a short press of the system button. |
static int |
BUTTON_O
Code for the O button. |
static int |
BUTTON_R1
Code for the right bumper button. |
static int |
BUTTON_R2
Deprecated. This code is unreliable on some controller firmwares. Use of analog axis value is recommended. |
static int |
BUTTON_R3
Code for right joystick button. |
static int |
BUTTON_U
Code for the U button. |
static int |
BUTTON_Y
Code for the Y button. |
static int |
MAX_CONTROLLERS
The maximum number of connected controllers. |
static float |
STICK_DEADZONE
The deadzone amount to use for the analog sticks. |
Method Summary | |
---|---|
boolean |
buttonChangedThisFrame(int ouyaButton)
Checks if a button state changed within the current frame loop (as signaled by calling startOfFrame). |
float |
getAxisValue(int ouyaAxis)
|
boolean |
getButton(int ouyaButton)
|
static OuyaController |
getControllerByDeviceId(int deviceId)
Get the current state of a controller |
static OuyaController |
getControllerByPlayer(int playerNum)
Get the controller for a specific player number |
android.view.InputDevice |
getDevice()
|
int |
getDeviceId()
|
int |
getPlayerNum()
|
static int |
getPlayerNumByDeviceId(int deviceId)
Get the player number for a specific device, in the range [0, MAX_CONTROLLERS), or -1 if no player found. |
static void |
init(android.content.Context context)
|
static boolean |
onGenericMotionEvent(android.view.MotionEvent event)
Called by the application to update the controller state |
static boolean |
onKeyDown(int keyCode,
android.view.KeyEvent event)
Called by the application to update the controller state |
static boolean |
onKeyUp(int keyCode,
android.view.KeyEvent event)
Called by the application to update the controller state |
static void |
startOfFrame()
Signals the start of a new frame loop. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BUTTON_O
public static final int BUTTON_U
public static final int BUTTON_Y
public static final int BUTTON_A
public static final int BUTTON_L1
@Deprecated public static final int BUTTON_L2
public static final int BUTTON_R1
@Deprecated public static final int BUTTON_R2
public static final int BUTTON_MENU
public static final int AXIS_LS_X
public static final int AXIS_LS_Y
public static final int AXIS_RS_X
public static final int AXIS_RS_Y
public static final int AXIS_L2
public static final int AXIS_R2
public static final int BUTTON_DPAD_UP
public static final int BUTTON_DPAD_RIGHT
public static final int BUTTON_DPAD_DOWN
public static final int BUTTON_DPAD_LEFT
public static final int BUTTON_R3
public static final int BUTTON_L3
public static final int MAX_CONTROLLERS
public static final float STICK_DEADZONE
Method Detail |
---|
public static void init(android.content.Context context)
public static OuyaController getControllerByDeviceId(int deviceId)
public static int getPlayerNumByDeviceId(int deviceId)
public static OuyaController getControllerByPlayer(int playerNum)
public static boolean onGenericMotionEvent(android.view.MotionEvent event)
public static boolean onKeyDown(int keyCode, android.view.KeyEvent event)
public static boolean onKeyUp(int keyCode, android.view.KeyEvent event)
public static void startOfFrame()
public boolean buttonChangedThisFrame(int ouyaButton)
public android.view.InputDevice getDevice()
public int getDeviceId()
public float getAxisValue(int ouyaAxis)
public boolean getButton(int ouyaButton)
public int getPlayerNum()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |