Read the current controller input
- Note:
- There are three button states; pressed, held, and release. Then there are a bunch of buttons. To check on a button, all you have to do is
if(button->STATE.BUTTON) { do stuff }
where STATE is the button state to check for and BUTTON is the button to check.
Available Button States:
- button->pressed.BUTTON (checks to see if the button was just pressed)
- button->held.BUTTON (checks to see if the button is being held)
- button->released.BUTTON (checks to see if the button was just released)
Available Buttons:
- select
- start
- up
- right
- down
- left
- L
- R
- triangle
- circle
- cross
- square
- home (requires kernel mode)
- hold (requires kernel mode)
- wlanOn (requires kernel mode)
- remote (requires kernel mode)
- volUp (requires kernel mode)
- volDown (requires kernel mode)
- screen (requires kernel mode)
- note (requires kernel mode)
- disc (requires kernel mode)
- ms (requires kernel mode)
Available Button Masks:
- MASK_NONE
- MASK_ALL
- MASK_SELECT
- MASK_START
- MASK_UP
- MASK_RIGHT
- MASK_DOWN
- MASK_LEFT
- MASK_LTRIG
- MASK_RTRIG
- MASK_TRIANGLE
- MASK_CIRCLE
- MASK_CROSS
- MASK_SQUARE
- MASK_HOME
- MASK_HOLD
- MASK_NOTE
- MASK_SCREEN
- MASK_VOLUP
- MASK_VOLDOWN
- MASK_WLANON
- MASK_REMOTE
- MASK_DISC
- MASK_MS
- Example: Check to see if the start button is pressed. If it is, then exit.
readInput ( MASK_NONE, 0, 0 );
if ( button->pressed.start )
sceKernelExitGame();
- Parameters:
-
| masked | - Buttons that will be effected by the intervals. |
| init | - Length of the first interval after a masked button is pressed + held until it's released. |
| interval | - Length of time between each recognized button press after a masked button is held until it's released. |
Definition at line 34 of file controller.c.
References CONTROLLER::analogX, CONTROLLER::analogY, CONTROLLER::held, CONTROLLER::pressed, CONTROLLER::released, CONTROLLER::repeatCounter, CONTROLLER::repeatInit, CONTROLLER::repeatInterval, CONTROLLER::repeatMask, and CONTROLLER::value.