PS2SDK
PS2 Homebrew Libraries
|
#include <libpad.h>
Go to the source code of this file.
Data Structures | |
struct | actuator_t |
struct | pad_t |
Macros | |
#define | MODE_DIGITAL 0 |
#define | MODE_ANALOG 1 |
#define | MODE_UNLOCKED 0 |
#define | MODE_LOCKED 1 |
#define | PAD_LEFT 0x0080 |
#define | PAD_DOWN 0x0040 |
#define | PAD_RIGHT 0x0020 |
#define | PAD_UP 0x0010 |
#define | PAD_START 0x0008 |
#define | PAD_R3 0x0004 |
#define | PAD_L3 0x0002 |
#define | PAD_SELECT 0x0001 |
#define | PAD_SQUARE 0x8000 |
#define | PAD_CROSS 0x4000 |
#define | PAD_CIRCLE 0x2000 |
#define | PAD_TRIANGLE 0x1000 |
#define | PAD_R1 0x0800 |
#define | PAD_L1 0x0400 |
#define | PAD_R2 0x0200 |
#define | PAD_L2 0x0100 |
Functions | |
pad_t * | pad_open (unsigned int port, unsigned int slot, unsigned int mode, unsigned int lock) |
static void | pad_get_buttons (pad_t *pad) |
void | pad_close (pad_t *pad) |
void | pad_wait (pad_t *pad) |
void | pad_set_mode (pad_t *pad, int mode, int lock) |
void | pad_set_sensitivity (pad_t *pad, int enable) |
void | pad_init_actuators (pad_t *pad) |
void | pad_set_actuators (pad_t *pad, int small, unsigned char large) |
int | pad_get_state (pad_t *pad) |
int | pad_get_num_modes (pad_t *pad) |
int | pad_has_type (pad_t *pad, int type) |
int | pad_get_type (pad_t *pad) |
int | pad_get_mode (pad_t *pad) |
Input library
Definition in file input.h.
struct actuator_t |
struct pad_t |
Data Fields | ||
---|---|---|
char | port | |
char | slot | |
char | mode | |
char | lock | |
int | type | |
char | state | |
char | last_state | |
char | exec_cmd | |
char | num_modes | |
char | sensitivity | |
struct padButtonStatus * | buttons | |
actuator_t * | actuator | |
char * | buffer |
pad_t * pad_open | ( | unsigned int | port, |
unsigned int | slot, | ||
unsigned int | mode, | ||
unsigned int | lock | ||
) |
Open and initialize a pad
Definition at line 10 of file input.c.
References mtapGetConnection(), pad_open(), pad_set_mode(), pad_wait(), and padPortOpen().
Referenced by pad_open().
|
inlinestatic |
void pad_close | ( | pad_t * | pad | ) |
void pad_wait | ( | pad_t * | pad | ) |
Wait until the pad is ready to accept commands
Definition at line 122 of file input.c.
References pad_get_state(), and pad_wait().
Referenced by pad_init_actuators(), pad_open(), pad_set_mode(), pad_set_sensitivity(), and pad_wait().
void pad_set_mode | ( | pad_t * | pad, |
int | mode, | ||
int | lock | ||
) |
Set the pad's mode and mode lock
Definition at line 215 of file input.c.
References pad_has_type(), pad_wait(), and padSetMainMode().
Referenced by pad_open().
void pad_set_sensitivity | ( | pad_t * | pad, |
int | enable | ||
) |
Set the pad's pressure sensitivity
Definition at line 261 of file input.c.
References pad_wait(), padEnterPressMode(), padExitPressMode(), and padInfoPressMode().
void pad_init_actuators | ( | pad_t * | pad | ) |
Init actuators
Definition at line 288 of file input.c.
References pad_wait(), padInfoAct(), padInfoMode(), and padSetActAlign().
void pad_set_actuators | ( | pad_t * | pad, |
int | small, | ||
unsigned char | large | ||
) |
int pad_get_state | ( | pad_t * | pad | ) |
Get the pad's state
Definition at line 103 of file input.c.
References padGetState().
Referenced by pad_wait().
int pad_get_num_modes | ( | pad_t * | pad | ) |
Get number of modes supported by pad
Definition at line 145 of file input.c.
References padInfoMode().
Referenced by pad_has_type().
int pad_has_type | ( | pad_t * | pad, |
int | type | ||
) |
Check if a type is supported by pad
Definition at line 178 of file input.c.
References pad_get_num_modes(), and padInfoMode().
Referenced by pad_set_mode().
int pad_get_type | ( | pad_t * | pad | ) |
int pad_get_mode | ( | pad_t * | pad | ) |
Get the pad's current mode