sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
input.h File Reference
#include <libpad.h>

Go to the source code of this file.

Classes

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)
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)

Detailed Description

Input library

Definition in file input.h.

Macro Definition Documentation

◆ MODE_ANALOG

#define MODE_ANALOG   1

Definition at line 13 of file input.h.

◆ MODE_DIGITAL

#define MODE_DIGITAL   0

Definition at line 12 of file input.h.

◆ MODE_LOCKED

#define MODE_LOCKED   1

Definition at line 16 of file input.h.

◆ MODE_UNLOCKED

#define MODE_UNLOCKED   0

Definition at line 15 of file input.h.

◆ PAD_CIRCLE

#define PAD_CIRCLE   0x2000

Definition at line 28 of file input.h.

◆ PAD_CROSS

#define PAD_CROSS   0x4000

Definition at line 27 of file input.h.

◆ PAD_DOWN

#define PAD_DOWN   0x0040

Definition at line 19 of file input.h.

◆ PAD_L1

#define PAD_L1   0x0400

Definition at line 31 of file input.h.

◆ PAD_L2

#define PAD_L2   0x0100

Definition at line 33 of file input.h.

◆ PAD_L3

#define PAD_L3   0x0002

Definition at line 24 of file input.h.

◆ PAD_LEFT

#define PAD_LEFT   0x0080

Definition at line 18 of file input.h.

◆ PAD_R1

#define PAD_R1   0x0800

Definition at line 30 of file input.h.

◆ PAD_R2

#define PAD_R2   0x0200

Definition at line 32 of file input.h.

◆ PAD_R3

#define PAD_R3   0x0004

Definition at line 23 of file input.h.

◆ PAD_RIGHT

#define PAD_RIGHT   0x0020

Definition at line 20 of file input.h.

◆ PAD_SELECT

#define PAD_SELECT   0x0001

Definition at line 25 of file input.h.

◆ PAD_SQUARE

#define PAD_SQUARE   0x8000

Definition at line 26 of file input.h.

◆ PAD_START

#define PAD_START   0x0008

Definition at line 22 of file input.h.

◆ PAD_TRIANGLE

#define PAD_TRIANGLE   0x1000

Definition at line 29 of file input.h.

◆ PAD_UP

#define PAD_UP   0x0010

Definition at line 21 of file input.h.

Function Documentation

◆ pad_close()

void pad_close ( pad_t * pad)
extern

Close the pad

Definition at line 82 of file input.c.

◆ pad_get_mode()

int pad_get_mode ( pad_t * pad)
extern

Get the pad's current mode

◆ pad_get_num_modes()

int pad_get_num_modes ( pad_t * pad)
extern

Get number of modes supported by pad

Definition at line 145 of file input.c.

◆ pad_get_state()

int pad_get_state ( pad_t * pad)
extern

Get the pad's state

Definition at line 103 of file input.c.

◆ pad_get_type()

int pad_get_type ( pad_t * pad)
extern

Get the pad's type

Definition at line 206 of file input.c.

◆ pad_has_type()

int pad_has_type ( pad_t * pad,
int type )
extern

Check if a type is supported by pad

Definition at line 178 of file input.c.

◆ pad_init_actuators()

void pad_init_actuators ( pad_t * pad)
extern

Init actuators

Definition at line 288 of file input.c.

◆ pad_open()

pad_t * pad_open ( unsigned int port,
unsigned int slot,
unsigned int mode,
unsigned int lock )
extern

Open and initialize a pad

Definition at line 10 of file input.c.

◆ pad_set_actuators()

void pad_set_actuators ( pad_t * pad,
int small,
unsigned char large )
extern

Set actuators

Definition at line 326 of file input.c.

◆ pad_set_mode()

void pad_set_mode ( pad_t * pad,
int mode,
int lock )
extern

Set the pad's mode and mode lock

Definition at line 215 of file input.c.

◆ pad_set_sensitivity()

void pad_set_sensitivity ( pad_t * pad,
int enable )
extern

Set the pad's pressure sensitivity

Definition at line 261 of file input.c.

◆ pad_wait()

void pad_wait ( pad_t * pad)
extern

Wait until the pad is ready to accept commands

Definition at line 122 of file input.c.